In SQL, which keyword is used in conjunction with SELECT to return only unique values from a column?
AQA A Level · Computer Science 7517
結構化查詢語言(SQL):练习题
5 道选择题即时批改,另有 5 道文字题附完整解题步骤,全部围绕「結構化查詢語言(SQL)」。
Consider the following SQL query:
SELECT ProductName
FROM Products
WHERE Price BETWEEN 10 AND 20;
What is the result of this query?
A database contains two tables: Student (StudentID, Name) and Enrollment (EnrollmentID, StudentID, Course).
Which query correctly retrieves the names of students enrolled in the 'Computer Science' course?
Which SQL command is used to add a new record to a table in a relational database?
Which of the following SQL statements correctly changes the 'City' value to 'London' for all records in the 'Customers' table where the 'ID' is 5?
State the SQL command used to remove all records from a table named LogData where the status is 'expired'.
先自己写一遍答案,再对照解题步骤。
In SQL, what is the purpose of the LIKE operator, and which wildcard character is used to represent zero or more characters?
先自己写一遍答案,再对照解题步骤。
In SQL, what is the specific difference between using a primary key and a foreign key when establishing relationships between two tables?
先自己写一遍答案,再对照解题步骤。
Write a SQL query to retrieve the FirstName and LastName of all students from a table named Students who scored more than 80 marks in a subject called 'Computer Science'. Assume the Students table is linked to a Grades table via StudentID.
先自己写一遍答案,再对照解题步骤。
A developer needs to define a new table Project using SQL. The table must include:
- ProjectID: An integer that serves as the primary key.
- ProjectName: A string up to 50 characters, which cannot be null.
- StartDate: A date field.
- Budget: A decimal value representing currency.
Write the SQL DDL (Data Definition Language) command to create this table.
先自己写一遍答案,再对照解题步骤。
* thinka 提供的内容由 AI 生成,未必在任何情况下都完全准确或最新,请结合官方教材与教师指导使用。
想多做几道同类题目?立即开始练习这个课题,边做边批改。
立即练习