I've just started learning SQL and just wanted to check if my answers are correct.
There are two tables Contacts and Departments. Create the following SQL queries.
(i) Find all contacts who surname begins with D.
SELECT * FROM contacts where surname like "d*";
(ii) Find all contacts whose name is john and is older than 45.
SELECT * FROM contacts where firstname like "john" and where age > 45;
(iii) Delete all departments whose department head is Dana Black
DELETE FROM departments
WHERE DeptHead='Dana Black';
(iv) Display all contacts that belong to the department description is maths
SELECT * FROM contacts WHERE Dept_Description like "maths";
(v) Add the following contact Jim White, age 33, phone: 123456789
INSERT INTO contacts
VALUES ('Jim', 'White', '33', '123456789');
(vi) Write an SQL statement to create the contacts table
CREATE TABLE contacts;
It would be great if someone could help me out here or confirm my answers are correct. I don't have access to Microsoft Access at the moment (no pun intended) Thanks.