database design and implementation. done so far… started a design of your own data model in...
TRANSCRIPT
![Page 1: Database Design And Implementation. Done so far… Started a design of your own data model In Software Engineering, recognised the processes that occur](https://reader036.vdocuments.site/reader036/viewer/2022082518/5697bf7a1a28abf838c83319/html5/thumbnails/1.jpg)
Database Design
And Implementation
![Page 2: Database Design And Implementation. Done so far… Started a design of your own data model In Software Engineering, recognised the processes that occur](https://reader036.vdocuments.site/reader036/viewer/2022082518/5697bf7a1a28abf838c83319/html5/thumbnails/2.jpg)
Done so far…
• Started a design of your own data model
• In Software Engineering, recognised the processes that occur in the system.
![Page 3: Database Design And Implementation. Done so far… Started a design of your own data model In Software Engineering, recognised the processes that occur](https://reader036.vdocuments.site/reader036/viewer/2022082518/5697bf7a1a28abf838c83319/html5/thumbnails/3.jpg)
To do…
• Implement the data model using CREATE statements– In SQL Server– In Oracle
• Populate the data model using inserts• Design
– Queries that will be relevant to the system– Transactions that will cause the data to flow
through the system.
![Page 4: Database Design And Implementation. Done so far… Started a design of your own data model In Software Engineering, recognised the processes that occur](https://reader036.vdocuments.site/reader036/viewer/2022082518/5697bf7a1a28abf838c83319/html5/thumbnails/4.jpg)
Data model
– Give the attributes:• data types• Check constraints
– Note any checks that need to be done that cannot be done in the CREATE statement.
• Later, these can be implemented through triggers.
– Decide on the sample of data you want to use to populate your model.
![Page 5: Database Design And Implementation. Done so far… Started a design of your own data model In Software Engineering, recognised the processes that occur](https://reader036.vdocuments.site/reader036/viewer/2022082518/5697bf7a1a28abf838c83319/html5/thumbnails/5.jpg)
Implementing your model in SQL Server
• Keep your SQL Server SQL separate from your Oracle SQL.– Set up a SQL Server implementation directory
for your .SQL files.• E.g. U:\databases\SQLServer\MYMODEL.SQL
– Implement the CREATEs in SQL Server– Populate the model using ‘INSERT’
statements.
![Page 6: Database Design And Implementation. Done so far… Started a design of your own data model In Software Engineering, recognised the processes that occur](https://reader036.vdocuments.site/reader036/viewer/2022082518/5697bf7a1a28abf838c83319/html5/thumbnails/6.jpg)
Implementing your model in SQL Server
• Keep your SQL Server SQL separate from your Oracle SQL.– Set up a SQL Server implementation directory
for your .SQL files.• E.g. U:\databases\SQLServer\MYMODEL.SQL
– Implement the CREATEs in SQL Server– Populate the model using ‘INSERT’
statements.
![Page 7: Database Design And Implementation. Done so far… Started a design of your own data model In Software Engineering, recognised the processes that occur](https://reader036.vdocuments.site/reader036/viewer/2022082518/5697bf7a1a28abf838c83319/html5/thumbnails/7.jpg)
Copy to Oracle
• Set up an Oracle implementation directory– E.g. U:\databases\Oracle\
• Copy the SQL from your SQL Server directory
• Note the differences in syntax between Oracle create and SQL Server create.
• Change the Oracle SQL.
![Page 8: Database Design And Implementation. Done so far… Started a design of your own data model In Software Engineering, recognised the processes that occur](https://reader036.vdocuments.site/reader036/viewer/2022082518/5697bf7a1a28abf838c83319/html5/thumbnails/8.jpg)
Design your processes
• Using the processes uncovered in Software Engineering– Design transactions to implement those
processes
• Design queries that would be useful in your system.– When you think about this, it can help you to
decide what data you want in your system.
![Page 9: Database Design And Implementation. Done so far… Started a design of your own data model In Software Engineering, recognised the processes that occur](https://reader036.vdocuments.site/reader036/viewer/2022082518/5697bf7a1a28abf838c83319/html5/thumbnails/9.jpg)
More Data Manipulation language
• We have done:– Insert– Select
• To do:– Delete– Update
![Page 10: Database Design And Implementation. Done so far… Started a design of your own data model In Software Engineering, recognised the processes that occur](https://reader036.vdocuments.site/reader036/viewer/2022082518/5697bf7a1a28abf838c83319/html5/thumbnails/10.jpg)
Delete
• To delete from a table:– Delete from <table> where <condition>
• E.g.(see handout)– Delete from STUDENT where MINIT like ‘B’;
• Note:– 1. This may not work. Look at the handout
and decide why.
![Page 11: Database Design And Implementation. Done so far… Started a design of your own data model In Software Engineering, recognised the processes that occur](https://reader036.vdocuments.site/reader036/viewer/2022082518/5697bf7a1a28abf838c83319/html5/thumbnails/11.jpg)
Update
Update <tablename>
set <field> = <expression>
Where <condition>
e.g.
Update student
set FNAME = ‘Sidney’
Where SID = 2222;