From the course: Ethical Hacking: SQL Injection

Unlock the full course today

Join today to access over 24,700 courses taught by industry experts.

Using SQL

Using SQL

- Now we've got our SQL database set up. Let's see how we use it. We've already seen how to list all records in a database. Let's see how we select just a subset of the table. Select star from Pharaoh, where the dynasty equals 23. And we get just those pharaohs who ruled in the 23rd dynasty. We can look at partial matches using the percent sign. Select star from Pharaoh, where name like Shoshenq, percent. And we get Shoshenq one to five. We can change a field by using the update command. Update, Pharaoh set dynasty equals zero, where name equals Shoshenq three. Let's look at the Shoshenq family again, and we can see Shoshenq three has a zero dynasty value. Let's set that back to what it was originally. Set dynasty equals 23, where name is Shoshenq the third. We can also add records using the insert verb ,and delete records using the delete verb. And we can remove tables using the…

Contents