Open the App

Subjects

Computer Science

9 Dec 2025

320

1 page

Ultimate SQL Cheat Sheet for Easy Database Queries

user profile picture

Daniel @zendayasbrother

Ever wondered how websites store and retrieve massive amounts of data? SQL (Structured Query Language) is the secret... Show more

N5 SQL Cheat Sheet
INSERT Statements - Entering every field in a record
INSERT Statements add new records into the database
Specify the tabl

N5 SQL Essential Commands

SELECT statements are your go-to tool for finding specific information in a database. You'll need four key components what fields you want (SELECT), which table to look in (FROM), your search conditions (WHERE), and how to sort results (ORDER BY).

Here's the magic formula SELECT name, age FROM pupil WHERE age <18 ORDER BY name; This grabs names and ages of pupils under 18, sorted alphabetically. Remember to use speech marks around text values, and you can combine conditions using AND, OR, and NOT.

INSERT statements let you add fresh data to tables. The simplest approach adds values for every field INSERT INTO Instructor VALUES 5,DThomas,1985/11/30,55, 'D Thomas', '1985/11/30',5; Just remember that field order matters massively here!

Sometimes you only need to fill certain fields. In that case, specify exactly which ones INSERT INTO Instructor (InstructorID, Name) VALUES (5, 'D Thomas'); SQL dates follow the yyyy/mm/dd format, so '1985/11/30' means 30th November 1985.

Top Tip Always double-check your field order when inserting data - getting this wrong is one of the most common SQL mistakes!

DELETE and UPDATE statements handle removing and changing existing data. DELETE works like DELETE FROM Course WHERE CourseID = 'BMX05'; Be careful though - forget the WHERE clause and you'll delete everything! UPDATE follows this pattern UPDATE Course SET Date = '2017/12/11' WHERE DATE = '2017/12/10';

EQUI joins connect related tables using matching key fields. This powerful technique lets you pull information from multiple tables simultaneously SELECT Instructor.Name, Course.Title FROM Instructor, Course WHERE Course.InstructorID = Instructor.InstructorID;

We thought you’d never ask...

What is the Knowunity AI companion?

Our AI Companion is a student-focused AI tool that offers more than just answers. Built on millions of Knowunity resources, it provides relevant information, personalised study plans, quizzes, and content directly in the chat, adapting to your individual learning journey.

Where can I download the Knowunity app?

You can download the app from Google Play Store and Apple App Store.

Is Knowunity really free of charge?

That's right! Enjoy free access to study content, connect with fellow students, and get instant help – all at your fingertips.

8

Smart Tools NEW

Transform this note into: ✓ 50+ Practice Questions ✓ Interactive Flashcards ✓ Full Mock Exam ✓ Essay Outlines

Mock Exam
Quiz
Flashcards
Essay

Similar content

Object-Oriented Programming Essentials

Explore the fundamental concepts of Object-Oriented Programming (OOP) with this comprehensive guide. Covering key topics such as classes, objects, inheritance, encapsulation, polymorphism, and class diagrams, this resource is designed for AQA A-Level Computer Science students. Understand the principles of OOP and how to effectively apply them in programming.

Computer ScienceComputer Science
12

Python Programming Constructs

Explore essential Python programming constructs including variables, control structures, operators, and data types. This summary covers key definitions such as strings, arrays, and the differences between local and global variables, providing a solid foundation for understanding Python basics.

Computer ScienceComputer Science
12

Programming Techniques Overview

Explore essential programming techniques including recursion, iteration, and modular programming. This summary covers key concepts such as algorithms, debugging, and data abstraction, providing a clear understanding of problem-solving methods in computer science. Ideal for OCR A-Level Computer Science students.

Computer ScienceComputer Science
13

Programming Constructs Overview

Explore essential programming constructs including loops, conditionals, and object-oriented principles. This summary covers key concepts such as recursion, encapsulation, inheritance, and the differences between local and global variables. Ideal for OCR A Level Computer Science students preparing for Component 2.2.

Computer ScienceComputer Science
12

Pseudocode Essentials

Explore key concepts of pseudocode including assignment statements, conditional statements, loops, and object-oriented programming. This summary covers essential programming constructs such as arrays, inheritance, and string handling, providing a comprehensive overview for students learning to write pseudocode effectively.

Computer ScienceComputer Science
12

Most popular content in Computer Science

Most popular content

Can't find what you're looking for? Explore other subjects.

Students love us — and so will you.

4.9/5

App Store

4.8/5

Google Play

The app is very easy to use and well designed. I have found everything I was looking for so far and have been able to learn a lot from the presentations! I will definitely use the app for a class assignment! And of course it also helps a lot as an inspiration.

Stefan S

iOS user

This app is really great. There are so many study notes and help [...]. My problem subject is French, for example, and the app has so many options for help. Thanks to this app, I have improved my French. I would recommend it to anyone.

Samantha Klich

Android user

Wow, I am really amazed. I just tried the app because I've seen it advertised many times and was absolutely stunned. This app is THE HELP you want for school and above all, it offers so many things, such as workouts and fact sheets, which have been VERY helpful to me personally.

Anna

iOS user

Best app on earth! no words because it’s too good

Thomas R

iOS user

Just amazing. Let's me revise 10x better, this app is a quick 10/10. I highly recommend it to anyone. I can watch and search for notes. I can save them in the subject folder. I can revise it any time when I come back. If you haven't tried this app, you're really missing out.

Basil

Android user

This app has made me feel so much more confident in my exam prep, not only through boosting my own self confidence through the features that allow you to connect with others and feel less alone, but also through the way the app itself is centred around making you feel better. It is easy to navigate, fun to use, and helpful to anyone struggling in absolutely any way.

David K

iOS user

The app's just great! All I have to do is enter the topic in the search bar and I get the response real fast. I don't have to watch 10 YouTube videos to understand something, so I'm saving my time. Highly recommended!

Sudenaz Ocak

Android user

In school I was really bad at maths but thanks to the app, I am doing better now. I am so grateful that you made the app.

Greenlight Bonnie

Android user

very reliable app to help and grow your ideas of Maths, English and other related topics in your works. please use this app if your struggling in areas, this app is key for that. wish I'd of done a review before. and it's also free so don't worry about that.

Rohan U

Android user

I know a lot of apps use fake accounts to boost their reviews but this app deserves it all. Originally I was getting 4 in my English exams and this time I got a grade 7. I didn’t even know about this app three days until the exam and it has helped A LOT. Please actually trust me and use it as I’m sure you too will see developments.

Xander S

iOS user

THE QUIZES AND FLASHCARDS ARE SO USEFUL AND I LOVE THE SCHOOLGPT. IT ALSO IS LITREALLY LIKE CHATGPT BUT SMARTER!! HELPED ME WITH MY MASCARA PROBLEMS TOO!! AS WELL AS MY REAL SUBJECTS ! DUHHH 😍😁😲🤑💗✨🎀😮

Elisha

iOS user

This apps acc the goat. I find revision so boring but this app makes it so easy to organize it all and then you can ask the freeeee ai to test yourself so good and you can easily upload your own stuff. highly recommend as someone taking mocks now

Paul T

iOS user

The app is very easy to use and well designed. I have found everything I was looking for so far and have been able to learn a lot from the presentations! I will definitely use the app for a class assignment! And of course it also helps a lot as an inspiration.

Stefan S

iOS user

This app is really great. There are so many study notes and help [...]. My problem subject is French, for example, and the app has so many options for help. Thanks to this app, I have improved my French. I would recommend it to anyone.

Samantha Klich

Android user

Wow, I am really amazed. I just tried the app because I've seen it advertised many times and was absolutely stunned. This app is THE HELP you want for school and above all, it offers so many things, such as workouts and fact sheets, which have been VERY helpful to me personally.

Anna

iOS user

Best app on earth! no words because it’s too good

Thomas R

iOS user

Just amazing. Let's me revise 10x better, this app is a quick 10/10. I highly recommend it to anyone. I can watch and search for notes. I can save them in the subject folder. I can revise it any time when I come back. If you haven't tried this app, you're really missing out.

Basil

Android user

This app has made me feel so much more confident in my exam prep, not only through boosting my own self confidence through the features that allow you to connect with others and feel less alone, but also through the way the app itself is centred around making you feel better. It is easy to navigate, fun to use, and helpful to anyone struggling in absolutely any way.

David K

iOS user

The app's just great! All I have to do is enter the topic in the search bar and I get the response real fast. I don't have to watch 10 YouTube videos to understand something, so I'm saving my time. Highly recommended!

Sudenaz Ocak

Android user

In school I was really bad at maths but thanks to the app, I am doing better now. I am so grateful that you made the app.

Greenlight Bonnie

Android user

very reliable app to help and grow your ideas of Maths, English and other related topics in your works. please use this app if your struggling in areas, this app is key for that. wish I'd of done a review before. and it's also free so don't worry about that.

Rohan U

Android user

I know a lot of apps use fake accounts to boost their reviews but this app deserves it all. Originally I was getting 4 in my English exams and this time I got a grade 7. I didn’t even know about this app three days until the exam and it has helped A LOT. Please actually trust me and use it as I’m sure you too will see developments.

Xander S

iOS user

THE QUIZES AND FLASHCARDS ARE SO USEFUL AND I LOVE THE SCHOOLGPT. IT ALSO IS LITREALLY LIKE CHATGPT BUT SMARTER!! HELPED ME WITH MY MASCARA PROBLEMS TOO!! AS WELL AS MY REAL SUBJECTS ! DUHHH 😍😁😲🤑💗✨🎀😮

Elisha

iOS user

This apps acc the goat. I find revision so boring but this app makes it so easy to organize it all and then you can ask the freeeee ai to test yourself so good and you can easily upload your own stuff. highly recommend as someone taking mocks now

Paul T

iOS user

 

Computer Science

320

9 Dec 2025

1 page

Ultimate SQL Cheat Sheet for Easy Database Queries

user profile picture

Daniel

@zendayasbrother

Ever wondered how websites store and retrieve massive amounts of data? SQL (Structured Query Language) is the secret weapon that lets you communicate with databases to find, add, edit, and delete information. Think of it as having a conversation with... Show more

N5 SQL Cheat Sheet
INSERT Statements - Entering every field in a record
INSERT Statements add new records into the database
Specify the tabl

Sign up to see the contentIt's free!

Access to all documents

Improve your grades

Join milions of students

By signing up you accept Terms of Service and Privacy Policy

N5 SQL Essential Commands

SELECT statements are your go-to tool for finding specific information in a database. You'll need four key components: what fields you want (SELECT), which table to look in (FROM), your search conditions (WHERE), and how to sort results (ORDER BY).

Here's the magic formula: SELECT name, age FROM pupil WHERE age <18 ORDER BY name; This grabs names and ages of pupils under 18, sorted alphabetically. Remember to use speech marks around text values, and you can combine conditions using AND, OR, and NOT.

INSERT statements let you add fresh data to tables. The simplest approach adds values for every field: INSERT INTO Instructor VALUES 5,DThomas,1985/11/30,55, 'D Thomas', '1985/11/30',5; Just remember that field order matters massively here!

Sometimes you only need to fill certain fields. In that case, specify exactly which ones: INSERT INTO Instructor (InstructorID, Name) VALUES (5, 'D Thomas'); SQL dates follow the yyyy/mm/dd format, so '1985/11/30' means 30th November 1985.

Top Tip: Always double-check your field order when inserting data - getting this wrong is one of the most common SQL mistakes!

DELETE and UPDATE statements handle removing and changing existing data. DELETE works like: DELETE FROM Course WHERE CourseID = 'BMX05'; Be careful though - forget the WHERE clause and you'll delete everything! UPDATE follows this pattern: UPDATE Course SET Date = '2017/12/11' WHERE DATE = '2017/12/10';

EQUI joins connect related tables using matching key fields. This powerful technique lets you pull information from multiple tables simultaneously: SELECT Instructor.Name, Course.Title FROM Instructor, Course WHERE Course.InstructorID = Instructor.InstructorID;

We thought you’d never ask...

What is the Knowunity AI companion?

Our AI Companion is a student-focused AI tool that offers more than just answers. Built on millions of Knowunity resources, it provides relevant information, personalised study plans, quizzes, and content directly in the chat, adapting to your individual learning journey.

Where can I download the Knowunity app?

You can download the app from Google Play Store and Apple App Store.

Is Knowunity really free of charge?

That's right! Enjoy free access to study content, connect with fellow students, and get instant help – all at your fingertips.

8

Smart Tools NEW

Transform this note into: ✓ 50+ Practice Questions ✓ Interactive Flashcards ✓ Full Mock Exam ✓ Essay Outlines

Mock Exam
Quiz
Flashcards
Essay

Similar content

Object-Oriented Programming Essentials

Explore the fundamental concepts of Object-Oriented Programming (OOP) with this comprehensive guide. Covering key topics such as classes, objects, inheritance, encapsulation, polymorphism, and class diagrams, this resource is designed for AQA A-Level Computer Science students. Understand the principles of OOP and how to effectively apply them in programming.

Computer ScienceComputer Science
12

Python Programming Constructs

Explore essential Python programming constructs including variables, control structures, operators, and data types. This summary covers key definitions such as strings, arrays, and the differences between local and global variables, providing a solid foundation for understanding Python basics.

Computer ScienceComputer Science
12

Programming Techniques Overview

Explore essential programming techniques including recursion, iteration, and modular programming. This summary covers key concepts such as algorithms, debugging, and data abstraction, providing a clear understanding of problem-solving methods in computer science. Ideal for OCR A-Level Computer Science students.

Computer ScienceComputer Science
13

Programming Constructs Overview

Explore essential programming constructs including loops, conditionals, and object-oriented principles. This summary covers key concepts such as recursion, encapsulation, inheritance, and the differences between local and global variables. Ideal for OCR A Level Computer Science students preparing for Component 2.2.

Computer ScienceComputer Science
12

Pseudocode Essentials

Explore key concepts of pseudocode including assignment statements, conditional statements, loops, and object-oriented programming. This summary covers essential programming constructs such as arrays, inheritance, and string handling, providing a comprehensive overview for students learning to write pseudocode effectively.

Computer ScienceComputer Science
12

Most popular content in Computer Science

Most popular content

Can't find what you're looking for? Explore other subjects.

Students love us — and so will you.

4.9/5

App Store

4.8/5

Google Play

The app is very easy to use and well designed. I have found everything I was looking for so far and have been able to learn a lot from the presentations! I will definitely use the app for a class assignment! And of course it also helps a lot as an inspiration.

Stefan S

iOS user

This app is really great. There are so many study notes and help [...]. My problem subject is French, for example, and the app has so many options for help. Thanks to this app, I have improved my French. I would recommend it to anyone.

Samantha Klich

Android user

Wow, I am really amazed. I just tried the app because I've seen it advertised many times and was absolutely stunned. This app is THE HELP you want for school and above all, it offers so many things, such as workouts and fact sheets, which have been VERY helpful to me personally.

Anna

iOS user

Best app on earth! no words because it’s too good

Thomas R

iOS user

Just amazing. Let's me revise 10x better, this app is a quick 10/10. I highly recommend it to anyone. I can watch and search for notes. I can save them in the subject folder. I can revise it any time when I come back. If you haven't tried this app, you're really missing out.

Basil

Android user

This app has made me feel so much more confident in my exam prep, not only through boosting my own self confidence through the features that allow you to connect with others and feel less alone, but also through the way the app itself is centred around making you feel better. It is easy to navigate, fun to use, and helpful to anyone struggling in absolutely any way.

David K

iOS user

The app's just great! All I have to do is enter the topic in the search bar and I get the response real fast. I don't have to watch 10 YouTube videos to understand something, so I'm saving my time. Highly recommended!

Sudenaz Ocak

Android user

In school I was really bad at maths but thanks to the app, I am doing better now. I am so grateful that you made the app.

Greenlight Bonnie

Android user

very reliable app to help and grow your ideas of Maths, English and other related topics in your works. please use this app if your struggling in areas, this app is key for that. wish I'd of done a review before. and it's also free so don't worry about that.

Rohan U

Android user

I know a lot of apps use fake accounts to boost their reviews but this app deserves it all. Originally I was getting 4 in my English exams and this time I got a grade 7. I didn’t even know about this app three days until the exam and it has helped A LOT. Please actually trust me and use it as I’m sure you too will see developments.

Xander S

iOS user

THE QUIZES AND FLASHCARDS ARE SO USEFUL AND I LOVE THE SCHOOLGPT. IT ALSO IS LITREALLY LIKE CHATGPT BUT SMARTER!! HELPED ME WITH MY MASCARA PROBLEMS TOO!! AS WELL AS MY REAL SUBJECTS ! DUHHH 😍😁😲🤑💗✨🎀😮

Elisha

iOS user

This apps acc the goat. I find revision so boring but this app makes it so easy to organize it all and then you can ask the freeeee ai to test yourself so good and you can easily upload your own stuff. highly recommend as someone taking mocks now

Paul T

iOS user

The app is very easy to use and well designed. I have found everything I was looking for so far and have been able to learn a lot from the presentations! I will definitely use the app for a class assignment! And of course it also helps a lot as an inspiration.

Stefan S

iOS user

This app is really great. There are so many study notes and help [...]. My problem subject is French, for example, and the app has so many options for help. Thanks to this app, I have improved my French. I would recommend it to anyone.

Samantha Klich

Android user

Wow, I am really amazed. I just tried the app because I've seen it advertised many times and was absolutely stunned. This app is THE HELP you want for school and above all, it offers so many things, such as workouts and fact sheets, which have been VERY helpful to me personally.

Anna

iOS user

Best app on earth! no words because it’s too good

Thomas R

iOS user

Just amazing. Let's me revise 10x better, this app is a quick 10/10. I highly recommend it to anyone. I can watch and search for notes. I can save them in the subject folder. I can revise it any time when I come back. If you haven't tried this app, you're really missing out.

Basil

Android user

This app has made me feel so much more confident in my exam prep, not only through boosting my own self confidence through the features that allow you to connect with others and feel less alone, but also through the way the app itself is centred around making you feel better. It is easy to navigate, fun to use, and helpful to anyone struggling in absolutely any way.

David K

iOS user

The app's just great! All I have to do is enter the topic in the search bar and I get the response real fast. I don't have to watch 10 YouTube videos to understand something, so I'm saving my time. Highly recommended!

Sudenaz Ocak

Android user

In school I was really bad at maths but thanks to the app, I am doing better now. I am so grateful that you made the app.

Greenlight Bonnie

Android user

very reliable app to help and grow your ideas of Maths, English and other related topics in your works. please use this app if your struggling in areas, this app is key for that. wish I'd of done a review before. and it's also free so don't worry about that.

Rohan U

Android user

I know a lot of apps use fake accounts to boost their reviews but this app deserves it all. Originally I was getting 4 in my English exams and this time I got a grade 7. I didn’t even know about this app three days until the exam and it has helped A LOT. Please actually trust me and use it as I’m sure you too will see developments.

Xander S

iOS user

THE QUIZES AND FLASHCARDS ARE SO USEFUL AND I LOVE THE SCHOOLGPT. IT ALSO IS LITREALLY LIKE CHATGPT BUT SMARTER!! HELPED ME WITH MY MASCARA PROBLEMS TOO!! AS WELL AS MY REAL SUBJECTS ! DUHHH 😍😁😲🤑💗✨🎀😮

Elisha

iOS user

This apps acc the goat. I find revision so boring but this app makes it so easy to organize it all and then you can ask the freeeee ai to test yourself so good and you can easily upload your own stuff. highly recommend as someone taking mocks now

Paul T

iOS user