SQL can be an unforgiving language. Find out how to avoid common pitfalls.
When working with SQL there are…a few common mistakes that it's easy to make.…SQL is not a very forgiving language…if you don't have the syntax just right.…And the errors that you'll get back, can be cryptic at best.…So, if you're getting an error message,…be sure to read it…and see if it points you in the right direction.…If you have a syntax error that you just can't find,…start breaking down the statement into pieces that do work.…And then put the statement together again,…keeping an eye on when an error happens.…It's easy to miss a set of parentheses…or misspell a field name and when you're learning,…it can be tricky to remember the order of clauses…or whether a keyword is missing an important part.…
Keep in mind that if you're using a text string,…you need to put it in single quotes…for it to be treated as text.…And if for some reason your database has spaces…in field names, which is allowed,…but isn't really best practice,…you'll need to use backticks around the name of the field…when you use it in a statement.…
- Name the predicate of the following statement: SELECT EyeColor, Age FROM Student WHERE FirstName = 'Tim' ORDER BY LastName ASC;
- Explain what to use to enforce the order in which an expression must be evaluated if the WHERE clause contains multiple expressions to evaluate.
- Identify the best option to join two tables in a database to be able to display data from both.
- List a data type that is not numeric.
- Determine the result of running the following statement on a table containing columns col_1 and col_2:
- INSERT INTO Box (col_1, col_2) VALUES ('A', 'B'), ('A', 'B'), ('A', 'B'), ('A', 'B');
- Determine the best approach of deleting Jon Ramirez (ID 3452) from a Student table.