Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

QUESTION 1 What is the correct SQL syntax to create a table named Employees with columns ID , Name, and Age CREATE Employees

QUESTION 1
What is the correct SQL syntax to create a table named "Employees" with columns "ID", "Name", and "Age"
CREATE Employees (ID INT, Name VARCHAR(50), Age INT)
CREATE TABLE Employees (ID INT, Name VARCHAR(50), Age INT)
CREATE TABLE Employees (ID, Name, Age)
CREATE TABLE Employees: ID INT, Name VARCHAR(50), Age INT
QUESTION 2
Which SQL command would you use to create a table with a foreign key constraint?
CREATE TABLE Orders (OrderID INT, CustomerID INT FOREIGN KEY REFERENCES Customers(CustomerID))
CREATE TABLE Orders (OrderID INT, CustomerID INT, CONSTRAINT fk_customer FOREIGN KEY (CustomerID)
REFERENCES Customers(CustomerID))
CREATE TABLE Orders (OrderID INT, CustomerID INT, FOREIGN KEY (CustomerID) REFERENCES
Customers(CustomerID))
CREATE TABLE Orders (OrderID INT, CustomerID INT, fk_customer FOREIGN KEY (CustomerID) REFERENCES
Customers(CustomerID))
QUESTION 3
How do you specify a composite primary key when creating a table in SQL?
CREATE TABLE Orders (OrderID INT, ProductID INT, PRIMARY KEY OrderID, ProductID)
CREATE TABLE Orders (OrderID INT, ProductID INT, PRIMARY KEY (OrderID AND ProductID))
CREATE TABLE Orders (OrderID INT, ProductID INT, PRIMARY KEY (OrderID, ProductID))
CREATE TABLE Orders (OrderID INT, ProductID INT, PRIMARY KEYS (OrderID, ProductID))
QUESTION 4
Which SQL keyword is used to remove duplicate records in a result set?
UNIQUE
DISTINCT
DELETE
REMOVE
image text in transcribed

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access with AI-Powered Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Students also viewed these Databases questions