TIL

TIL

  • Docs
  • Contact
  • Feedback
  • Contribute

›Week 8

Getting Started

  • Introduction

Principles of Programming Languages

    Week 3

    • Pattern Matching and Recursive Data Types

    Week 8

    • Monads

Introduction to Databases

    Week 3

    • Cinema Database

    Week 4

    • Pine Valley Furniture
    • Pine Valley Furniture - Solution

    Week 5

    • ERD to Shorthand Conversions
    • ERD to Shorthand Conversions - Solution

    Week 6

    • Normalizations
    • Normalizations - Solutions

    Week 7

    • Other Normal Forms
    • Other Normal Forms - Solutions

    Week 8

    • SQL Introduction

    Week 9

    • More SQL

    Week 10

    • Joins and Subqueries

    Week 11

    • Functions, Procedures, Triggers and Embedded SQL

    Week 12

    • Prepared SQL Statements
Edit

SQL Introduction

Try to solve the following questions:

  1. Create a database and call it MyFirstPractice
  2. Create a table and call it MyFirstTable
  3. Try defining several attributes with different attribute type
  4. Try defining primary keys differently, by adding the PRIMARY KEY keyword in front of the field name and also by defining a constraint for a primary key
  5. Try defining a table that has a composite attribute and define the primary key by adding PRIMARY KEY in front of the fields
  6. When you are comfortable with CREATE TABLE, try to create the table graphically. (Right click on your database name and choose create table)
  7. Using the ALTER TABLE command:
        1. Add a column
        2. Add a column after specific column
        3. Delete a column
        4. Rename table name
        5. Drop a primary key
        6. Add a primary key
        7. Modify the definition of a column
        8. Modify the definition of column, drop primary key and rename table at the same time
  8. Repeat the above for several fields
  9. Drop the table
  10. Drop the database
Last updated on 1/4/2019
← Other Normal Forms - SolutionsMore SQL →
TIL
Docs
Getting StartedPrinciples of Programming Languages (C24)Introduction to Databases (C43)
Community
PiazzaQuercus
More
GitHubStar
Facebook Open Source
Copyright © 2019 Rakin Uddin