분류 전체보기 (150) 썸네일형 리스트형 [sqlite3] Using SQLite in IDEs 1. Using SQLite in Python 1.1 What is sqlite3 module? SQLite is a C library that provides a light weight disk-based database that doesn't require a separate server process and allows accessing file database using a nonstandard variant of the SQL query language. The sqlite3 module provides an SQL interface compliant with the DB-API 2.0. 1.2 How to use sqlite3 module? Step 1 : Import module The sq.. [psycopg2] SQL Injection and Ways to defened it 1. What is SQL Injection? SQL Injection is a method for code injection attack that intentionally exploits application security loopholes to cause malicious SQL statements to be executed, resulting in abnormal manipulation of the database. query = "SELECT * FROM users WHERE username = '" + name + "';" The above code selects a row that receives an ID and password from a user and matches it. Howeve.. [psycopg2] Optimizing Data Types of Tables 1. Check data type of table Inadequate data type schema cause errors when we write queries. The cursor.description attribute of the pyscopg2 package outputs the data type of the database table. The cursor.description property consists of a column object consisting of name and type_code. The name has the name of the column, and the type_code has an integer value corresponding to the data type. im.. [Syntax] Meaning of dot Notation We should also notice the familiar "dot" notation for asking an object to invoke a method. List.append(item) can be read as "ask the object List to perform its append method and send it the value item." Even simple data objects such as integers can invoke methods in this way. (54).__add__(21) In this fragment we are asking the integer object 54 to execute its add method (called __add__ in Python.. [psycopg2] SQL Transactions 1. What is SQL Transactions? A Database Transaction is a unit of interaction in a database management system or a similar system. Here, a similar system means a system in which transactions are clear, mutually independent, consistent, and reliable in success and failure. That is, it refers to a unit of work performed to change the state of the database. In theory, the database system guarentees .. [psycopg2] Executing Postgres query in Python script 1. Workflow of executing query in Python script psycopg2 is a package for using Postgres in Python script. In the same way as sqlite3, a conn instance and a cursor instance are created to create a query. In Postgres, we have transaction notation when we commit the queries to sever. A new transcation will automatically be created when we open a connection in psycopg2. When a commit is called, the.. [psycopg2] How to use Postgres in Python 1. What is Postgres? Relational Database Management System(RDBMS) is a set of software tools that allow multiple users to access data within a database. DBMS allows users or other programs to process and responds appropriately to use data. For SQLite, only a single process is allowed to write to the database (It only process query statement one by one.). Therefore, there is a limit to working wi.. [sqlite3] Creating a sqlite database from CSV file 1. How to create a sqlite database from CSV file? Step 1 : Creating a sqlite database sqlite is a ligthweight database that can be started as an empty text file. We can create the file with touch data.db. from pathlib import Path Path('cars.db').toucn() Step 2 : Create a connection and cursor object Create a database connection and cursor to execute queries. We can use functions called connect a.. [Syntax] Data Definition Language 1. What is DDL? In the context of SQL, Data Definition Language(DDL) is a syntax for creating and modifying database objects such as tables, indices, and users. DDL statement are similar to a computer programming language for defining dat structures, especially database schemas. Common examples of DDL statements include CREATE, ALTER, and DROP. 2. CREATE CREATE clause make tables in database. CR.. [Syntax] Writing Efficient Query 1. Views In a database, a View is the result set of a stored query on the data, which the database users can query just as they would in a persistent database collection object. This pre-established query command is kept in the database dictionary. Unlike ordinary base tables in relational database, a view doesn't form part of physical schema. A a result, it is a virtual table computed or collec.. [Syntax] Merging Tables 1. What is MERGE? The MERGE statement in SQL is a clause that can handle insert, update, and deletes all in a single transaction without having to write sepatate logic for each of these. Using the MERGE statement in SQL gives us better flexibility in customizing our complex SQL scripts and also enhances the readability of our scripts. 2. Kinds of Merge clause We can join data from more than two .. [Syntax] Data Manipulation Language 1. What is DML? DML(Data Manipulation Language) is a family of computer language including commands permitting users to manipulate data in database. This manipulation involves inserting data into database tables, retreiving existing data, deleting data from existing tables and modifying existing data. 2. Select Cluases Query is a precise request for information retreval with database and informa.. [Theorem] What is SQLite? 1. What is SQL? SQL(Structured Query Language) is specific purposed programming language to manipulate tables from relational database management system(RDBMS). SQL was structured for createing and manipulating schemas, querying data and handling accessment of database object. 2. What is SQLite? SQLite is a database engine written in the C language. It is not a standlaone app; rather, it is a li.. [CS] Fundamental concepts of Computer Science 1. What is Computer Science? Computer Science is the study of problems, problem-solving, and the solutions that come out of the problem-solving process. Given a problem, a computer scientist's goal is to develop an algorithm. However, we must be careful to include the fact that some problems may not have solutions. So we can say that computer science is the study of problems that are and that ar.. [collections] Make frequency table automatically 1. What is the collections library? The Python library collections implements specialized container datatypes providing alternatives to Python's general purpose built in containers, dict, list, set, and tuple. The Counter method provide dict subclass for counting hashable objects. When we pass a string or list to the Counter constructor as a factor, an object is returned that tells us how many t.. [python] Python Scripts 1. Shell Variables Unlike Python, the method of defining a variable through the command language sets the variable name only in uppercase letters. Because the shell destinguishes the command from the parameter options based on the blanks, it is marked with "" if there is a blank in the value of the variable. In addition, the assignment operator must be defined in the variable name without spaces.. [Theorem] Standard Streams/File Descriptors 1. Standard Streams A stream refers to the flow of data, and all processes in progress interact with the environment through the stream. And process refers to a program being executed. A parent process is a process that occurs before other processes, and a child process is a process that runs after the parent process. Standard Streams refers to input/output channels that are preconnected between.. [Theorem] Redirection/Pipeline 1. Redirection Redirection is a common instruction that allows a computing system to change the stdout of a standard stream to a custom location. The location can be specified through > operator, and it is a job to save the results performed through the command as a file. A simple redirection operator is a task of erasing data from an existing file and rewriting the contents. To add new data to .. [Theorem] Owner/Permissions 1. What is Owner? Owner refers to a person who uses a computer system in a computing environment. Users should attempt to authenticate for purposes such as security, login history, and resource management. When attempting to authenticate, the user must have an account and user name, and use the user interface to access the system and process authentication. There are many users connected to one .. [CS] Complexity of Algorithms 1. What is an Algorithms? An algorithm is a set of procedures of methods for solving any problems in mathematics, computer science, lingustics, or related fields. It refers to a step-by-step procedure for executing a calculation and also refers to a set of program instructions. 2. Time Compleixty of Algorithms Time comlexity refers to a functional relationship between the time it takes to solve .. 이전 1 2 3 4 5 6 7 8 다음