Answer the question
In order to leave comments, you need to log in
Which SQL query will display the most frequently occurring records?
Hello. There is a test library database that I created myself. There are two tables: BOOKS and POSSESSION. The first stores information about books (title, author, year of publication, publisher and number of books in the library). In the second information about who, what downwards, when he took and handed over. The data model in the figure:
I need to find out the most popular author of the year. Actually here is the request I made:
SELECT AUTHOR
FROM POSSESSION
INNER JOIN BOOKS ON BOOK_ID = BOOKS.ID
WHERE TAKING_DATE > (CURRENT_DATE - INTERVAL '1 year')
GROUP BY AUTHOR
ORDER BY COUNT(AUTHOR) DESC
LIMIT 1;
Answer the question
In order to leave comments, you need to log in
select
t1.AUTHOR,
t1.total
from
(
SELECT AUTHOR, count(*) as total
FROM POSSESSION
INNER JOIN BOOKS ON BOOK_ID = BOOKS.ID
WHERE TAKING_DATE > (CURRENT_DATE - INTERVAL '1 year')
GROUP BY AUTHOR
) t1
where t1.total =
(
select
max(t2.total)
from
(
SELECT AUTHOR, count(*) as total
FROM POSSESSION
INNER JOIN BOOKS ON BOOK_ID = BOOKS.ID
WHERE TAKING_DATE > (CURRENT_DATE - INTERVAL '1 year')
GROUP BY AUTHOR
) t2
)
Will a client ping another client with address 10.45.18.194 and why?
Collected topology on GNS3:
On the first question:
Will a client ping another client with address 10.45.18.194 and why?Yes, pings pass:
ClientA#ping 10.45.18.194 repeat 10
Type escape sequence to abort.
Sending 10, 100-byte ICMP Echos to 10.45.18.194, timeout is 2 seconds:
!!!!!!!!!!
Success rate is 100 percent (10/10), round-trip min/avg/max = 20/34/48 ms
The client on the router changes the interface configuration to:
Interface e0/0
Ip address 10.45.18.15 255.255.255.128
Ip address 10.45.19.15 255.255.255.0 sec
No shutdown
!
Will the address 10.45.19.15 be present in the ARP table of the ISP's router?
shutdown
, no shutdown
), the provider's router will receive an ARP packet (because ARP is broadcast), but it may well not take it into account, given the lack of a route to 10.45.19.0/24 via incoming interface:ISP#sh arp
Protocol Address Age (min) Hardware Addr Type Interface
Internet 10.45.18.5 - 00ff.ffff.ffff ARPA FastEthernet0/0
Internet 10.45.18.15 24 00aa.aaaa.aaaa ARPA FastEthernet0/0
Internet 10.45.18.194 22 00bb.bbbb.bbbb ARPA FastEthernet0/0
ISP#
*Mar 1 01:24:18.735: IP ARP: rcvd rep src 10.45.18.15 00aa.aaaa.aaaa, dst 10.45.18.15 FastEthernet0/0
*Mar 1 01:24:18.739: IP ARP rep filtered src 10.45.19.15 00aa.aaaa.aaaa, dst 10.45.19.15 ffff.ffff.ffff wrong cable, interface FastEthernet0/0
*Mar 1 01:24:18.739: IP ARP: rcvd rep src 10.45.18.15 00aa.aaaa.aaaa, dst 10.45.18.15 FastEthernet0/0
*Mar 1 01:24:18.739: IP ARP rep filtered src 10.45.19.15 00aa.aaaa.aaaa, dst 10.45.19.15 ffff.ffff.ffff wrong cable, interface FastEthernet0/0
ISP#sh arp
Protocol Address Age (min) Hardware Addr Type Interface
Internet 10.45.18.5 - 00ff.ffff.ffff ARPA FastEthernet0/0
Internet 10.45.18.15 0 00aa.aaaa.aaaa ARPA FastEthernet0/0
Internet 10.45.18.194 23 00bb.bbbb.bbbb ARPA FastEthernet0/0
If the mask is /25 on the client 10.45.18.194, then it will be, if /24, then no.
Here the whole question is how the packets will go, through the gateway or inside one broadcast domain, it all depends on the mask on the host of another client. Recording in arp will be, because. arp request is broadcast and will go to the gateway as well.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question