Computer Science
What is the degree and cardinality of a table having 10 rows and 5 columns?
SQL Queries
1 Like
Answer
The degree of a table is 5 and the cardinality of a table is 10.
Answered By
2 Likes
Related Questions
Write SQL Commands/output for the following on the basis of the given table GRADUATE:
Table: GRADUATE
S.No. NAME STIPEND SUBJECT AVERAGE RANK 1 KARAN 400 PHYSICS 68 1 2 RAJ 450 CHEMISTRY 68 1 3 DEEP 300 MATHS 62 2 4 DIVYA 350 CHEMISTRY 63 1 5 GAURAV 500 PHYSICS 70 1 6 MANAV 400 CHEMISTRY 55 2 7 VARUN 250 MATHS 64 1 8 LIZA 450 COMPUTER 68 1 9 PUJA 500 PHYSICS 62 1 10 NISHA 300 COMPUTER 57 2 (i) List the names of those students who have obtained rank 1 sorted by NAME.
(ii) Display a list of all those names whose AVERAGE is greater than 65.
(iii) Display the names of those students who have opted COMPUTER as a SUBJECT with an AVERAGE of more than 60.
(iv) List the names of all the students in alphabetical order.
(v) SELECT * FROM GRADUATE WHERE NAME LIKE "%I%";
(vi) SELECT DISTINCT RANK FROM GRADUATE;
What is the difference between Candidate key and Alternate key?
For the given table, do as directed:
Table: STUDENT
ColumnName Data type size Constraint ROLLNO Integer 4 Primary Key SNAME Varchar 25 Not Null GENDER Char 1 Not Null DOB Date Not Null FEES Integer 4 Not Null HOBBY Varchar 15 Null (i) Write SQL query to create the table.
(ii) Write SQL query to increase the size of SNAME to hold 30 characters.
(iii) Write SQL query to remove the column HOBBY.
(iv) Write SQL query to insert a row in the table with any values of your choice that can be accommodated there.
Write SQL queries based on the following tables:
Table: PRODUCT
P_ID ProductName Manufacturer Price Discount TP01 Talcum Powder LAK 40 NULL FW05 Face Wash ABC 45 5 BS01 Bath Soap ABC 55 NULL 5H06 Shampoo XYZ 120 10 FW12 Face Wash XYZ 95 NULL Table: CLIENT
C_ID ClientName City P_ID 01 Cosmetic Shop Delhi TP01 02 Total Health Mumbai FW05 03 Live Life Delhi BS01 04 Pretty Woman Delhi 5H06 05 Dreams Delhi FW12 (i) Write SQL Query to display ProductName and Price for all products whose Price is in the range 50 to 150.
(ii) Write SQL Query to display details of products whose manufacturer is either XYZ or ABC.
(iii) Write SQL query to display ProductName, Manufacturer and Price for all products that are not giving any discount.
(iv) Write SQL query to display ProductName and price for all products whose ProductName ends with 'h'.
(v) Write SQL query to display ClientName, City, P_ID and ProductName for all clients whose city is Delhi.
(vi) Which column is used as Foreign Key and name the table where it has been used as Foreign key?