Save
Upgrade to remove ads
Busy. Please wait.
Log in with Clever
or

show password
Forgot Password?

Don't have an account?  Sign up 
Sign up using Clever
or

Username is available taken
show password


Make sure to remember your password. If you forget it there is no way for StudyStack to send you a reset link. You would need to create a new account.
Your email address is only used to allow you to reset your password. See our Privacy Policy and Terms of Service.


Already a StudyStack user? Log In

Reset Password
Enter the associated with your account, and we'll email you a link to reset your password.
focusNode
Didn't know it?
click below
 
Knew it?
click below
Don't Know
Remaining cards (0)
Know
0:00
Embed Code - If you would like this activity on your web page, copy the script below and paste it into your web page.

  Normal Size     Small Size show me how

DBWP

Databases and Web Programming

QuestionAnswer
What is a DBMS? Database Management System - a software designed to assist in maintaining and utilising large collections of data
What are some advantages of using a DBMS? Data organization and management, reduced data redundancy and inconsistency, multi-user access, data integrity and accuracy
What is a relational database? Collections of n-ary relations where the associations forming the relation are represented as tables. Each table represents a relation, each column represents a domain (“attribute”), each row represents a specific association, case or tuple (“record)”
What is redundancy and why may it arise? The storing of the same information more than once. This may happen due to repeating data, storing derived attributes, adding checksums, etc.
What is a DBMS transaction? A unit of work executed by a DBMS, ie any manipulation of the database. A transaction may involve one or more operations, with either all or none executed.
What are the desirable properties of a transaction? ACID - Atomic (treated as a unit), Consistent (Guarantee database remains correct), Isolated (Even if executed concurrently, database is left in same state that it would have), Durable (Effects remain even in system failure)
What is an ER model? An Entity Relationship model is a graphical representation of a database that shows relationships between pieces of information. It helps to understand structure of data, how they connect, and what rules apply.
In an ER model, how are single valued, multi valued, key and derived attributes respectively represented? Singlevalued: Ellipses Multi valued: Double ellipses Key: Names underlined Derived: Dashed ellipses
What are the common cardinalities of entity relationships, and some examples for each? 1:1 - One person has one passport One -to - many - One lecturer teaches many modules. Many - to - many - A student can take many modules, modules have many students
What is JDL? JHipster Domain Language. It is domain-specific used by JHipster to describe an application’s domain model.
List the benefits of using JDL. Text-based, easy to modify, version-control friendly, less ambiguous, integrates directly with JHipster.
If you had an entity student, with attributes name, email and date of birth, how would you set that up with a JDL model? entity Student { name String email String dateOfBirth LocalDate }
What are some primitive modifiers used in JDL? unique - values must be unique across all instances required - value is mandatory and cannot be null minlength(n) and maxlength() - length constraints min(x) and max(y) - value constraints
Using JDL relationship syntax, how would you set up a one to many relationship between lecturer and modules? relationship OneToMany { Lecturer{modules} to Module{lecturer} }
How do you setup an enum in JDL? (e.g an orderstatus with pending, shipped, delivered and cancelled statuses) enum OrderStatus { PENDING, SHIPPED, DELIVERED, CANCELLED, }
Why do we need database normalisation? Makes the database more efficient, prevents duplicates, ensures consistency and relevance, ensures accuracy, reduces storage time, optimise query execution times, etc.
What is needed for a table to be in 1NF? A single cell must not hold more than one value, there must be a primary key, no duplicated rows or columns, each column must have only one value for each row in the table.
What is needed for a table to be in 2NF? Must be in 1NF and each non-key attribute must be functionally dependent on the entire primary key. This is a relationship where one attribute determines the value of another attribute.
What is needed for a table to be in 3NF? Must be in 2NF and have no transitive functional dependencies. This means every non-key attribute must depend on only the primary key, and no other non-prime attributes.
How might you use SQL commands to create a table called room with room_id, room_name, room_capacity and room_zoom? CREATE TABLE public.room ( room_id text NOT NULL, room_name text, room_capacity integer, room_zoom text, PRIMARY KEY (room_id) );
What are CRUD commands in SQL? Creating data, Reading data, Updating data and Deleting data. In SQL, these are performed by INSERT, SELECT, UPDATE and DELETE.
If you had a table named albums, with attributes album_name and tracklist_length, how would you insert "Wishbone" and "12"? INSERT INTO public.albums ( album_name, tracklist_length ) VALUES ("Wishbone", 12);
If you had a table named albums, with an attribute tracklist_length set to 12 for an album_name "Wishbone", how would you update the tracklist length to be 17? UPDATE public.albums SET tracklist_length = 17 WHERE album_name = "Wishbone";
If you had a table named albums, how would you select all albums which have a tracklist_length of 10? SELECT * from public.albums WHERE tracklist_length = 10;
If you had a table named albums, with an album_name attribute "Wishbone", how would you delete this from the table? DELETE FROM public.albums WHERE album_name = "Wishbone";
In PostgreSQL, how do you create a role named testuser with password 'password'? CREATE ROLE testuser NOINHERIT LOGIN PASSWORD 'password';
In PostgreSQL, how do you create a database named todo_list with owner as testuser? CREATE DATABASE todo_list WITH OWNER = testuser ENCODING = 'UTF8' CONNECTION LIMIT = -1;
Created by: user-2035207
 

 



Voices

Use these flashcards to help memorize information. Look at the large card and try to recall what is on the other side. Then click the card to flip it. If you knew the answer, click the green Know box. Otherwise, click the red Don't know box.

When you've placed seven or more cards in the Don't know box, click "retry" to try those cards again.

If you've accidentally put the card in the wrong box, just click on the card to take it out of the box.

You can also use your keyboard to move the cards as follows:

If you are logged in to your account, this website will remember which cards you know and don't know so that they are in the same box the next time you log in.

When you need a break, try one of the other activities listed below the flashcards like Matching, Snowman, or Hungry Bug. Although it may feel like you're playing a game, your brain is still making more connections with the information to help you out.

To see how well you know the information, try the Quiz or Test activity.

Pass complete!
"Know" box contains:
Time elapsed:
Retries:
restart all cards