Use app×
Join Bloom Tuition
One on One Online Tuition
JEE MAIN 2025 Foundation Course
NEET 2025 Foundation Course
CLASS 12 FOUNDATION COURSE
CLASS 10 FOUNDATION COURSE
CLASS 9 FOUNDATION COURSE
CLASS 8 FOUNDATION COURSE
0 votes
42.1k views
in Computer by (72.4k points)

Consider the following tables CARDEN and CUSTOMER and answer (b) and (c) parts of this question:

1. Give a suitable example of a table with sample data and illustrate Primary and Alternate Keys in it.

2. Write SQL commands for the following statements:

o To display the names of all the silver coloured cars.

o To display names of car, make and capacity of cars in descending order of their sitting capacity.

o To display the highest charges at which a vehicle can be hired from CARDEN.

o To display the customer name and the corresponding name of the cars hired by them.

3. Give the output of the following SQL queries:

o SELECT COUNT(DISTINCT Make) FROM CARDEN;

o SELECT MAX(Charges), MIN (Charges) FROM CARDEN;

o SELECT COUNTS), Make FROM CARDEN;

1 Answer

0 votes
by (89.5k points)
selected by
 
Best answer

1. Primary Key of CARDEN = C code CARDEN 

Alternate Key = CarName: 

Primary key of Customer = Code 

Alternate Key of Customer = Cname 2

2. SELECT CarName From CARDEN

(i)  WHERE Color = “SILVER”;

(ii) SELECT CarName, Make, Capacity From 

 CARDEN ORDER BY Capacity DESC;

(iii) SELECT MAX(Charges) Frm CARDEN;

(iv) ELECT Cname, CarName From CARDEN, CUSTOMER WHERE CARDEN. Ccode = CUSTOMER. Ccode;

3. (i) 4 

  (ii) MAX(Charges) MIN (Charges) 35 112 

  (iii) 5 

  (iv) SX4 C Class

Welcome to Sarthaks eConnect: A unique platform where students can interact with teachers/experts/students to get solutions to their queries. Students (upto class 10+2) preparing for All Government Exams, CBSE Board Exam, ICSE Board Exam, State Board Exam, JEE (Mains+Advance) and NEET can ask questions from any subject and get quick answers by subject teachers/ experts/mentors/students.

Categories

...