Quiz 2 Flashcards
None of the options are correct.
To display all the name of bus stop locations that is used as the starting point of a bus route.
σQuantity > 5 (Product ⋈Product.ProductID = Order.ProductID Order)
The Student table may contain more than one student with the same age.
Trigger
Property JOIN Owner USING(OwnerID)
The correct answer is: None of these options are correct.
8
The correct answer is: A cursor handler is not compulsory
CALL Mystery7(5, @c);
ΠProductName, Price (Product)
Property JOIN Owner USING(OwnerID)
Can you give me an example of creating a table for students in SQL. There needs to be a student id (PK), first name, last name and age
CREATE TABLE Students (
StudentID INT PRIMARY KEY,
FirstName VARCHAR(50),
LastName VARCHAR(50),
Age INT
);
What is the syntax to insert values into a table in SQL?
INSERT INTO table_name (column1, column2, … columnN)
VALUES (value1, value2, … valueN);
What is an example of the syntax to insert values into a table in SQL for Students?
INSERT INTO Students (StudentID, FirstName, LastName, Age)
VALUES (1, ‘John’, ‘Doe’, 20);
What is the syntax to create a comment in SQL
It is “–”
What is the syntax to use a database in SQL
if the database is called “Database1” then the syntax is “use Database1”
If a value wants to be added with an int and the int needs to be a positive number what to you add to the line
UNSIGNED
If a value wants to be added with an int and the int needs to not be NULL what to you add to the line
NOT NULL
How to see information from a DBMS using SQL
Type the following:
SELECT ‘information’
From databasename;
How to count the number of enrolmentIDS from denormalisation table
How to show all the information from the denormalisation table
Using the following information use SQL code to see how many enrolments does each student have
Using the following information use SQL code to see how many enrolments does each student have. Sort them by first name in descending order