Version control systems, Git and GitHub and databases Flashcards

(39 cards)

1
Q

What is version control system

A

It’s a system that allows to manage changes made to a software project over time
* Tracking changes
- revision history
- list of (snapshots +
timestamps)
- diff between snapshots
* Reverting to previous versions (snapshots) of the code
* Easing collaboration
- keeps track and helps
unify conflicting versions
of the same file

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What are the two types of vcs

A

1.Centralized VCS
2.Distributes VCS

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

Explain what a centralized VCS is

A

➢ central server with single main repository
➢ revision history on the central server only
➢ need to be connected to the server for
most operations
➢ multiple co-existing versions of the same
artefacts if modified by different persons
➢ e.g., SVN

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

Explain what a distributed VCS is

A

➢ central server + local copy of the
repository with revision history
➢ every dev has full control of their local
repository
➢ most operations do not need connection
to the server
➢ merge modifications with the new
modifications of the central repository
➢ e.g., Gi

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

What is Git

A

It’s a distributed VCS with the key features like tracking changes and collaboration

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

Explain Working Directory vs Staging Area vs Local Git Repository vs Remote Git Repository

A

Working directory is where you have all the files open on your personal laptop and staging area is where you code goes when you call git add, local repository is where your code goes after git commit and finally your code goes to remote git repository when you call git push

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

How do you clone an existing repository

A

git clone <url></url>

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

How to turn a local directory into a git repository

A

git init

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

How to stage untracked files

A

git add file.text

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

How to check what files are untracked in the working tree

A

git status

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

How to create a new snapshot

A

git commit –m “message”

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

How to list the commits in reverse chronological order

A

git log

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

How to get the abbreviated stats for each commit

A

git log –stat

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

How to unstage files from staged to modified

A

git reset HEAD file.txt

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

How to discard changes in the working tree to revert the file before modification
or replace it with the one of last snapshot

A

git checkout file.txt or edit manually

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

How to update the changed files/git message of the last commit

A

git commit –amend
> git commit –m “added files lectures 1 to 5”
> git add lecture-6.pdf
> git commit –amend –m “added files lectures 1 to 6

17
Q

How to undo changes of a commit and does not delete the commit
and replays it in reverse
and create a new commit for reverting the change

A

git revert <commit></commit>

18
Q

What are remote repositories

A

They are versions of your project hosted somewhere else

19
Q

what command do you use to show the remotes of your repository

A

git remote –v

20
Q

What command do you use to download data from the remote repo to your local repo

21
Q

what does git pull do?

A

it fetches + merges data with your working tree
- pull = fetch + merge

22
Q

what command do you use to send your commits to the remote repository

23
Q

What does merge do

A

If files are modified after your last commit > git pull
➢ If there is at least a commit you don’t have on your local repo
➢ your push is rejected
➢ to continue, you have to merge

You must first pull the commits you don’t have to your local repository
* If no conflict, the merge is automatic
* If conflicts exist, you must solve them manually

24
Q

What is data persistence?

A

Data created in the context of a running process must persist/be recovered after the process has ended therefore must be stored in a long-lasting storage medium.

25
What are data persistence approaches
o data files o databases
26
What are data files
they are file systems stored on disk, storing regular files such as documents and images.They are flat-file databases(e.g.,CSV and JSON data)
27
what are the pros of data files
They are easy to understand and easy to work with.
28
What are the cons of using data files
- suboptimal storage usage - suboptimal retrieval performance
29
Define databases
They are organized collection of structured information designed to store and retrieve data efficiently.
30
What are the cons of using databases
Optimal storage usage and optimal retrieval performance
31
What are the cons of using databases
- they are complex to work with - They require specialized maintenance and operators
32
What is database management system(DBMS)
-It's a software system that enables users to define, create, maintain and control access to the database -It's where databases are managed.
33
Define relational databases
- They store data in tables which can be linked to one another. -It's maintained with relational database management system(RDBMS) E.g.: MySQL, PostgreSQL (open source), Oracle Database, Microsoft SQL Server, DB2 (IBM) - They use Structured Query Language(SQL) for querying data in relational databases.
34
Discuss NoSQL Databases
Non-SQL or Not-only SQL o do not use traditional SQL queries o large amounts of unstructured or semi- structured data ▪ usually, simple data o flexible and scalable Unstructured data: text, image / Semi-structured data: JSON, XML, CSV Key-value database: collection of key-value pairs (e.g., Riak and Redis) Graph database: Store and query graph data (nodes and edge) (e.g., Neo4j, Neptune, OrientDB)
35
Discuss tables in relational database
○ name ○ columns + rows ○ fixed number of columns (can be modified) ○ theoretically unlimited number of rows
36
Discuss columns in relational database
○ name + data type ▪ e.g., McGillId (int), year (date), firstName (char), description (text) ○ represent attributes of the data
37
Discuss rows in relational database
○ record / observation / entry ○ instance of the table columns ○ has a value for each column
38
Relational database design
1) Dividing tables to avoid redundancies * McGillId, FirstName, LastName in the same table * Course, Name in the same table 2) Identifying each instance with a unique identifier * one primary key per table * preferably, one column * can be a combination of columns * e.g., McGillId, CourseID (underlined in the table) 3) Referring to rows in other tables o as much foreign keys as necessary o foreign key = column whose values are primary keys of another table (refers to one row) => Still redundant information in Offering
39