Structured Query Language (SQL)
Class 12 · Computer Science · 32 Questions
Using the sports database containing two relations (TEAM, MATCH_DETAILS) and write the queries for the following: Display the MatchID of all those matches where both the teams have scored more than 70.
What do you understand by Cartesian Product?
Write the output produced by the following SQL statement: SELECT POW(2,3);
Write the output produced by the following SQL statement: SELECT LEFT("INDIA",3), RIGHT("Computer Science",4), MID("Informatics",3,4), SUBSTR("Practices",3);
Suppose your school management has decided to conduct cricket matches between students of Class XI and Class XII. Students of each class are asked to join any one of the four teams – Team Titan, Team Rockers, Team Magnet and Team Hurricane. During summer vacations, various matches will be conducted between these teams. Help your sports teacher to do the following: Create a database “Sports”.
Create a table “TEAM” with following considerations:
Using table level constraint, make TeamID as the primary key.
As per the preferences of the students four teams were formed as given below. Insert these four rows in TEAM table: Row 1: (1, Team Titan) Row 2: (2, Team Rockers) Row 3: (3, Team Magnet) Row 3: (4, Team Hurricane)
Further, they should be able to assign a new UCode to an item only if it has a valid UName. Write a query to add appropriate constraints to the SCHOOLUNIFORM database.
Using the sports database containing two relations (TEAM, MATCH_DETAILS) and write the queries for the following: Display the MatchID of all those matches where FirstTeam has scored less than 70 but SecondTeam has scored more than 70.
Using the sports database containing two relations (TEAM, MATCH_DETAILS) and write the queries for the following: Display the MatchID and date of matches played by Team 1 and won by it.
Using the CARSHOWROOM database given in the chapter, write the SQL queries for the following: List the total number of cars having no discount.
Using the CARSHOWROOM database given in the chapter, write the SQL queries for the following: Display the name of the costliest car with fuel type “Petrol”.
What are the minimum and maximum income values that can be entered in the income attribute given the data type is INT?
Define RDBMS. Name any two RDBMS software.
Site any two differences between Single Row Functions and Aggregate Functions.
Differentiate between the following statements:
Write the name of the functions to perform the following operations:
Write the output produced by the following SQL statement: SELECT ROUND(342.9234,-1);
Write the output produced by the following SQL statement: SELECT LENGTH("Informatics Practices");