Содержание
- 2. Basic SQL query structure Basic SQL query structure consists of SELECT, FROM, WHERE, GROUP BY and
- 3. Data manipulation INSERT Inserts a tuple into the specified table INSERT INTO tablename (list of columns)
- 4. Inserting Create a new student Harvey Specter: INSERT INTO students (student_id, firstname, lastname) VALUES (1, 'Harvey',
- 5. Updating Change firstname of all students having student_id = 1 to ‘John’: UPDATE students SET firstname
- 6. Deleting Delete student having student_id = 1 from table students: DELETE FROM students WHERE student_id =
- 7. Expressions Calculate expression 1 + 1 and name it as two: SELECT 1 + 1 AS
- 8. Tables Return list of all students: SELECT * FROM students 07.09.2016 Data Modeling and Databases
- 9. Exercise Insert a new department named ‘Machine Learning’ and leaded with professor identified by professor_id =
- 10. Exercise Find the address of the student with first name "Donna” SELECT address FROM students WHERE
- 11. Exercise Find all students who are either male or are from Kazan SELECT * FROM students
- 12. Exercise Find all courses that worth at least 9 credits and are given by MSIT department
- 13. Exercise Find names and salaries of professors who earn less than 15 000 SELECT firstname, lastname,
- 14. Exercise Find students born earlier than 1980 SELECT * FROM students WHERE birthdate 07.09.2016 Data Modeling
- 15. Exercise List full names of all students living in Moscow Hint: concatenation operator a || b
- 16. Exercise Find students who's address contains "k" letter SELECT * FROM students WHERE address LIKE '%k%'
- 17. Exercise Find students who's lastname consists of 7 letters and ends with "n” SELECT * FROM
- 18. Exercise Order and display students by lastname (alphabetically) SELECT * FROM students ORDER BY lastname 07.09.2016
- 19. Exercise Order and display students by lastname and then by firstname (alphabetically) SELECT * FROM students
- 20. Exercise Order by login : first letter of firstname + full lastname in descending order Hint:
- 21. Exercise Find names of male students who got more than 50 for any course 07.09.2016 Data
- 22. Exercise Which students are enrolled in DMD course? 07.09.2016 Data Modeling and Databases SELECT s.* FROM
- 24. Скачать презентацию