Giter Club home page Giter Club logo

comp-421-databases-term-project's People

Contributors

affogarty avatar lmok avatar

Watchers

 avatar  avatar  avatar

comp-421-databases-term-project's Issues

Write SQL database schema

Write an SQL database schema for the relational schema you have designed using the CREATE TABLE command and enter it in the DB2 database. Choose suitable data types for your attributes. Indicate primary keys, foreign keys or any other integrity constraints that you can express with the commands learnt. Indicate the constraints you cannot express. The Online Information contains detailed information about data types, and the CREATE TABLE statement.

Turn in your CREATE TABLE statements. Furthermore, (i) for DB2 use command line processor command DESCRIBE tablename (ii) for PostgreSQL use table name (prints the description of the relation on the screen) for each of your relations, print the result and turn it in.

Create 2 views

Create two views on top of your database schema.

Turn in an informal description what data each of the views represents, show
your CREATE VIEW statements and the response of the system. Also, show
a query involving each view and the system response (but truncate the
response if there are more than a few tuples produced.

TA doesn't like "InChargeOf" relation

The TA thinks that InChargeOf means that the patient is in charge of the department, and not the other way around. Perhaps we should give it a new name?

Refs #2

Execute five INSERT commands

Execute five INSERT commands to insert tuples into one of your relations.
Turn in your INSERT statements. Furthermore, print and turn in the
response of CPL/psql when you type the INSERT commands. Print and turn
in the result when you issue a SELECT * FROM relationname command.

Write 4 data modification commands

Write four data modification commands for your application. Most of
these commands should be \interesting," in the sense that they involve some
complex feature, such as inserting the result of a query, updating several tuples at
once, or deleting a set of tuples that is more than one but less than all the tuples in
a relation.

Turn in a description of all the relations that you use in your modifications
but are not described so far. Provide a short description of what each of your
statements is supposed to do, the SQL statements themselves and a script or
screenshot that shows your modification commands running in a convincing
fashion.

Write 5 queries

Write five queries on your project database, using the select-from-where construct of SQL. The queries should be typical queries of the application domain. To receive full credit, all but perhaps one of your queries should exhibit some interesting feature of SQL: queries over more than one relation, subqueries, aggregations, grouping etc.

Turn in a description of all the relations that you use in your queries (e.g., the original create statements or printouts from the SQL \describe table yourname" function), a description of what each of your queries is supposed to do, the SQL statement of each query, along with a script illustrating their execution (for example the screenshot when you execute the query). Your script should be su_cient to convince us that your commands run successfully. Please do not, however, turn in query results that are more than 50 lines long.

Populate tables

Insert in all your tables enough meaningful information so that the
queries that you create provide meaningful results. The results of the following
queries that you develop should have a reasonable number of results so that we
can be convinced that your queries are correct (maybe 5-10 tuples). If you have
real-world data, feel free to import it. Information of how to import data into DB2
tables is provided on my courses.

For each table show the output, truncated to the first 5-10 tuples, that are
returned when you issue a SELECT * FROM relationname command.

Add 2 CHECK constraints

Add two CHECK constraints to relations of your database schema.

Turn in the revised schema, its successful declaration, and the response of
DB2 to modifications (insert/update) that violate the constraints.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.