1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
Zarrin [17]
3 years ago
8

The kings and queens of England are listed in a relation Kings(name,nickname,house,beginReign,endReign). Their name is unique, e

ither using a Roman numeral to distinguish them, e.g., 'Edward I' or 'Edward II', or in a few cases using their nickname, e.g., 'Edward the Confessor'. The attribute nickname is an additional appelation, if they have one and it is not used in their name to distinguish them, e.g., 'The Unready'. The value of nickname is NULL if there is no nickname. The attribute house is the dynasty, e.g., 'Tudor'. Attribute beginReign and endReign are integers, the first and last years, respectively, that the king or queen was on the throne. There is also a relation Parents(child,parent). Both attributes are the names of kings or queens, with the obvious connection that the first is a child of the second. Write the following queries: Who was king in the year 1000? Give the name and nickname. Find all the pairs of kings or queens (A,B) such that A was the great grandchild of B. Find the name and nickname of all kings or queens that have a nickname that does not begin with "The". Find the names of those kings or queens that were the parent of two or more kings or queens. List each such person only once. Find for each house the number of kings or queens of that house. Several times in British history, kings or queens have deposed one another, so that their reigns overlapped. Find all such pairs, listing the pairs in both orders; i.e., list both (A,B) and (B,A). However, be careful not to list pairs A and B where the only overlap is that A's reign ended in the same year that B's began, or vice-versa.
Computers and Technology
1 answer:
Arada [10]3 years ago
5 0

Answer:

The answers to each question are explained below

Explanation:

Who was king in the year 1000? Give the name and nickname.

Query:

       SELECT name, nickname FROM Kings

      WHERE beginReign <=1000 AND endReign >=1000;

Explanation:

SELECT is used to query the database and get back the specified fields.

name and nickname are columns of Kings table.

FROM is used to query the database and get back the preferred information by specifying the table name.

Kings is a table name.

WHERE is used to specify a condition based on which the data is to be retrieved. The conditions are as follows:

beginReign <=1000

endReign >=1000

AND clause between the conditions indicate that both the conditions must be true.

Find all the pairs of kings or queens (A,B) such that A was the great grandchild of B.

Query:

       SELECT p.child, ggp.parent

       FROM Parents p, Parents gp, Parents ggp

       WHERE p.parent = gp.child AND gp.parent = ggp.child;

Explanation:

SELECT is used to query the database and get back the specified fields.

child is a column of Parents table aliased as p(parent).

parent is a column of Parents table aliased as ggp (great grand father).

FROM is used to query the database and get back the preferred information by specifying the table name.

parents is a table name. Three aliases named p(parent), gp(grand father) and ggp(great grand father) are created.

WHERE is used to specify a condition based on which the data is to be retrieved. The conditions are as follows:

p.parent = gp.child

gp.parent = ggp.child;

AND clause between the conditions indicate that both the conditions must be true.

Find the names of those kings or queens that were the parent of two or more kings or queens. List each such person only once.

Query:

       SELECT parent FROM Parents

       GROUP by parent

       HAVING COUNT(*) > 1;

Explanation:

SELECT is used to query the database and get back the specified fields.

parent is a column of Parents table .

FROM is used to query the database and get back the preferred information by specifying the table name.

parents is a table name.

Group by clause is used to group the data on column parent.

Having clause specifies the condition based on which the data is to be retrieved.

Find for each house the number of kings or queens of that house.

Query:

       SELECT house, COUNT(name)

       FROM Kings

       GROUP by house;

Explanation:

SELECT is used to query the database and get back the specified fields.

house is a column of Kings table .

FROM is used to query the database and get back the preferred information by specifying the table name.

Kings is a table name.

Group by clause is used to group the data on column house.

Several times in British history, kings or queens have deposed one another, so that their reigns overlapped. Find all such pairs, listing the pairs in both orders; i.e., list both (A,B) and (B,A). However, be careful not to list pairs A and B where the only overlap is that A's reign ended in the same year that B's began, or vice-versa.

Query:

      SELECT k1.name, k2.name FROM Kings k1, Kings k2

      WHERE k1.name <> k2.name

      AND k1.beginReign < k2.beginReign

      AND k2.beginReign < k1.beginReign;

Explanation:

SELECT is used to query the database and get back the specified fields.

name is a column of Kings table.

FROM is used to query the database and get back the preferred information by specifying the table name.

Kings is a table name. Two aliases named k1 and k2 are created.

WHERE is used to specify a condition based on which the data is to be retrieved. The conditions are as follows:

k1.name <> k2.name

k1.beginReign < k2.beginReign

k2.beginReign < k1.beginReign;

AND clause between the conditions indicate that both the conditions must be true.

You might be interested in
Which below best describes JavaScript? *
marysya [2.9K]

Answer:

it is a programing languwage that is useualy used to program visual or text based applications

Explanation:

6 0
3 years ago
Read 2 more answers
For successful completion of an 8-Week course, how often should I visit the course web site to check for new e-mail and any inst
Brilliant_brown [7]

Answer: The course web should be visited daily to check for new e-mail and any instructor announcement.

Explanation:

For any serious-minded and Intellectually inclined individual, who aimed for a successful completion of an 8-Week course, it's imperative for him/her to visit the course web site daily to check for new e-mail and any instructor announcements.

8 0
3 years ago
Joe, an end-user, reports that the Windows PC he is using automatically locks when he leaves his desk and walks to a printer to
ivann1987 [24]

Answer:

A. Domain-level group policies

Explanation:

Because domain-level polices are automatically implement all users that are login on the PC and PC is connect to the domain. From domain polices you can set what user can open and what can not open, Joe Windows PC he is using automatically locks also through domain policy, Administrator set the time when any end-user leave their PC automatically after the time set administrator screen saver run and asked password of that user to return back in the windows.

6 0
3 years ago
How many GPS satellites are required to pinpoint your location on earths surface? a.24 b.12 c.3 d.5
Neko [114]
In principle, three. In practice, three is not a very clean fix, and the more the better. But just mathematically, it's three.
3 0
3 years ago
Need help writing a program that reads a string if the option "E" (enter a string) is chosen, and checks if parentheses (), brac
allsm [11]

Answer:

is this even a question?...

4 0
3 years ago
Other questions:
  • Assume that to_the_power_of is a function that expects two int parameters and returns the value of the first parameter raised to
    11·1 answer
  • Jack and Diane are creating each ClassID following this pattern: first two letters of ClassName (one uppercase, one lowercase),
    7·1 answer
  • A video games sell for $59.99..
    13·1 answer
  • 6) Sometimes it is difficult to read a piece of code and understand what the code will do. For this reason, you may want to add
    9·1 answer
  • What type of tests is suitable for automated testing?
    12·1 answer
  • 4. Write an appropriate comment for describ-
    11·1 answer
  • If you are inserting an address block with the Address Block dialog box and the fields do not connect automatically, what can yo
    6·2 answers
  • You can remove selected text from a slide by pressing ctrl+x keyboard shortcut keys true or false
    7·1 answer
  • ____ is any technology that aids in gathering information about a person or organization without their knowledge.
    14·1 answer
  • Clarissa is a computer programming consultant. When a client states that they have an extremely complex programming task, which
    10·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!