<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>Forem: Lenique Noralez</title>
    <description>The latest articles on Forem by Lenique Noralez (@leniquenoralez).</description>
    <link>https://forem.com/leniquenoralez</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F84407%2F150a3789-3430-427a-b288-e75e90dec502.jpeg</url>
      <title>Forem: Lenique Noralez</title>
      <link>https://forem.com/leniquenoralez</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://forem.com/feed/leniquenoralez"/>
    <language>en</language>
    <item>
      <title>Networking via Twitter &amp; Dev.to</title>
      <dc:creator>Lenique Noralez</dc:creator>
      <pubDate>Sat, 11 May 2019 02:04:47 +0000</pubDate>
      <link>https://forem.com/leniquenoralez/networking-via-twitter-dev-to-164</link>
      <guid>https://forem.com/leniquenoralez/networking-via-twitter-dev-to-164</guid>
      <description>&lt;p&gt;I've read a lot of post on twitter with people saying that twitter is a very powerful networking tool. I've had a twitter account but I don't really use it, all I do is read people tweets and retweet. &lt;/p&gt;

&lt;p&gt;So I'd like to start a discuss to hear how different people network using twitter, dev.to or other social network and also in real life (Meetups, Hackathons etc.). &lt;/p&gt;

&lt;p&gt;Networking is something that is pretty hard for me. I recently moved to St.Louis from Belize and I've found it hard to network and meet other developers. I'm the only Developer at the company I'm working at so I'm not really connecting with other developers. &lt;/p&gt;

&lt;p&gt;So if any one have any great gems on networking I'd love to heard them.&lt;/p&gt;

</description>
      <category>discuss</category>
      <category>networking</category>
      <category>twitter</category>
      <category>devto</category>
    </item>
    <item>
      <title>DBMS For Application Development: SQL (Structured Query Language)</title>
      <dc:creator>Lenique Noralez</dc:creator>
      <pubDate>Mon, 08 Apr 2019 03:24:08 +0000</pubDate>
      <link>https://forem.com/leniquenoralez/dbms-for-application-development-sql-structured-query-language-331c</link>
      <guid>https://forem.com/leniquenoralez/dbms-for-application-development-sql-structured-query-language-331c</guid>
      <description>&lt;p&gt;Photo by &lt;a href="https://unsplash.com/@chrisliverani" rel="noopener noreferrer"&gt;Chris Liverani&lt;/a&gt; on &lt;a href="https://unsplash.com" rel="noopener noreferrer"&gt;Unsplash&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fimages.unsplash.com%2Fphoto-1518186285589-2f7649de83e0%3Fixlib%3Drb-1.2.1%26ixid%3DeyJhcHBfaWQiOjEyMDd9%26auto%3Dformat%26fit%3Dcrop%26w%3D1567%26q%3D80" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fimages.unsplash.com%2Fphoto-1518186285589-2f7649de83e0%3Fixlib%3Drb-1.2.1%26ixid%3DeyJhcHBfaWQiOjEyMDd9%26auto%3Dformat%26fit%3Dcrop%26w%3D1567%26q%3D80" alt="Laptop Screen"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;SQL is a programming language used to store, retrieve and manipulate data in a database.&lt;/p&gt;

&lt;p&gt;SQL is also used to define the schema of a database. When defining the schema for a table you can specify:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Data type of each attribute in the table&lt;/li&gt;
&lt;li&gt;The constraints on the attribute&lt;/li&gt;
&lt;li&gt;Name of each table column&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The basic data types of SQL are:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;char(short for character) - a fixed length string. The length is specified by the user.&lt;/li&gt;
&lt;li&gt;varchar(short for character varying) - is a variable length with a user defined max length &lt;/li&gt;
&lt;li&gt;int - an integer&lt;/li&gt;
&lt;li&gt;smallint - a smaller integer&lt;/li&gt;
&lt;li&gt;numeric - a fixed point number with a user defined precision number.&lt;/li&gt;
&lt;li&gt;real, double precision - floating-point and double-precision floating point numbers&lt;/li&gt;
&lt;li&gt;float - a floating point number with a user defined precision&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;em&gt;int&lt;/em&gt;, &lt;em&gt;smallest&lt;/em&gt;, &lt;em&gt;real&lt;/em&gt; and &lt;em&gt;double precision&lt;/em&gt; data type are machine dependent. The max length and precision of these data type are defined by the computer architecture on which the databases is stored. &lt;/p&gt;

&lt;p&gt;To create the schema for a table in SQL we use the create table command. &lt;br&gt;
Let’s define the the schema for a few tables in our photo sharing application.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;CREATE TABLE user(
    user_id INTEGER NOT NULL AUTO_INCREMENT,
    username VARCHAR(30),
    password VARCHAR(30),
    email_add VARCHAR(32),
    fullname VARCHAR(30),
    fb_id INTEGER,
    twitter_id INTEGER,
    profile_pic_url VARCHAR(30),
    privacy_level BOOLEAN,
    tag_option BOOLEAN,
    primary key (user_id, username, email_add),
);

CREATE TABLE followers(
    uid INTEGER
    follower_id INTEGER
    timestamp DATE
    rejectdenyoption INTEGER,
    foreign key (uid) references user
);

CREATE TABLE following(
    uid INTEGER
    follower_id INTEGER
    timestamp DATE
    rejectdenyoption INTEGER,
    foreign key (uid) references user
);
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;To insert data into our newly created tables we use:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;INSERT INTO table_name (column1, column2, column3, ...)
VALUES (value1, value2, value3, ...);
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;We can omit the column name:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;INSERT INTO table_name
VALUES (value1, value2, value3, ...);
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;But we must put the value in the order as defined in the table schema.&lt;/p&gt;

&lt;p&gt;Let's add a few records to our user table.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;INSERT INTO table_name (username, password, email_add, fullname, fb_id, twitter_id, profile_pic_url, privacy_level, tag_option)
VALUES (Jame_Bond_007, fakepassword, 'bond_james@hotmail.com' , 'Jame Bond' , 1847123, 1847123, 'https://cdn.photoshare.com', true, false);

INSERT INTO table_name (username, password, email_add, fullname, fb_id, twitter_id, profile_pic_url, privacy_level, tag_option)
VALUES (LilLeafHurricane, fakepassword, 'rocklee@gmail.com' , 'Rock Lee' , 3547126, 3547126, 'https://cdn.photoshare.com', true, false;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now we have data in our table. We need to retrieve that data to show it in our application. A query is a request to get data from our database. An SQL query consists of three parts, &lt;strong&gt;select&lt;/strong&gt;, &lt;strong&gt;from&lt;/strong&gt;, and &lt;strong&gt;where&lt;/strong&gt;. The &lt;strong&gt;from&lt;/strong&gt; clause tells us which tables we are querying. The &lt;strong&gt;select&lt;/strong&gt; clause tell us which columns we want to output from our query results. The &lt;strong&gt;where&lt;/strong&gt; clause is used to set condition on our query output. &lt;/p&gt;

&lt;p&gt;Let’s do a few query on our photo sharing application database.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;-- Select all user with private account
select username, email_add, profile_pic_url from user where privacy_level = true;

-- Get a specific user data
select * from user where username = 'username';

-- Get all user photo [Return only photo_id],user id is random
select photo_id from photo where uid = 98494

-- Get a specific user follower [Return follower id]
select follower_id from followers where uid = 64736 and follower_id = 12342

-- Get a specific user follower [Return follower id]
select follower_id from followers where uid = 64736 and follower_id = 12342
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;SQL provides aggregation functions, aggregation functions takes a collection as input and return a single value. &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Average: avg&lt;/li&gt;
&lt;li&gt;Minimum: min&lt;/li&gt;
&lt;li&gt;Maximum: max&lt;/li&gt;
&lt;li&gt;Total: sum&lt;/li&gt;
&lt;li&gt;Count: count&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Of all the aggregation function sum and avg can only have numbers as input.&lt;/p&gt;

&lt;p&gt;Here are a few examples using aggregation functions.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;-- Count all likes on a specific photo
select sum (photo_id) as likes from likes where photo_id= 090982;

-- Count all user followers
select sum (uid) as likes from followers where uid = 090982;

-- Count all people who user is following
select sum (uid) as likes from following where uid = 090982;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;There’s a lot of use case for the other aggregation function but to keep the examples simple I use sum since it’s use case is very simple in this application. &lt;/p&gt;

&lt;p&gt;SQL provides the set operations intersect, union and except that allows you to perform set operations on two tables.  The union operations combines the result of two queries into a single table. Any duplicates are eliminated. The intersect operation takes the the results of two queries and return only the records that are in both query result. The except operation takes the unique rows of a query results and returns the rows that do not appear in the second result set, except does not remove duplicates.&lt;/p&gt;

&lt;p&gt;Here is an example of a set operation using intercept to get all the liked photos two users share in common:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;-- Return the photo_id of all the images two user both like
SELECT photo_id
FROM   likes
WHERE  likerUID = 12345;
INTERSECT
SELECT photo_id
FROM   likes
WHERE  likerUID = 67890;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;SQL is a programming language used to interact with data in a database. SQL have special functions called aggregate functions that you can use to apply to a query results to returns a single output. You can perform set operations on the result of multiple queries to be combined into a single result.&lt;/p&gt;

&lt;h4&gt;
  
  
  Useful Resources:
&lt;/h4&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://www.youtube.com/watch?v=HXV3zeQKqGY" rel="noopener noreferrer"&gt;SQL - Full course for beginners&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>sql</category>
      <category>database</category>
      <category>softwaredevelopment</category>
      <category>beginners</category>
    </item>
    <item>
      <title>DBMS For Application Development: Relational Model &amp; Relational Database</title>
      <dc:creator>Lenique Noralez</dc:creator>
      <pubDate>Mon, 08 Apr 2019 03:24:02 +0000</pubDate>
      <link>https://forem.com/leniquenoralez/dbms-for-application-development-relational-model-relational-database-3nl8</link>
      <guid>https://forem.com/leniquenoralez/dbms-for-application-development-relational-model-relational-database-3nl8</guid>
      <description>&lt;p&gt;Photo by &lt;a href="https://unsplash.com/@kmuza" rel="noopener noreferrer"&gt;Carlos Muza&lt;/a&gt; on &lt;a href="https://unsplash.com" rel="noopener noreferrer"&gt;Unsplash&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fimages.unsplash.com%2Fphoto-1460925895917-afdab827c52f%3Fixlib%3Drb-1.2.1%26ixid%3DeyJhcHBfaWQiOjEyMDd9%26auto%3Dformat%26fit%3Dcrop%26w%3D2426%26q%3D80" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fimages.unsplash.com%2Fphoto-1460925895917-afdab827c52f%3Fixlib%3Drb-1.2.1%26ixid%3DeyJhcHBfaWQiOjEyMDd9%26auto%3Dformat%26fit%3Dcrop%26w%3D2426%26q%3D80" alt="Laptp"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;A &lt;strong&gt;data model&lt;/strong&gt; is an abstract model used to organize your application data  and describes how your data relate to one another and real world objects.&lt;br&gt;
There are many types of data models but the most widely used one is the relational model due to its simplicity.&lt;/p&gt;

&lt;p&gt;The relational model represents data in tables and are grouped into relationships. A database that uses the relational model is known as a relational database. &lt;/p&gt;

&lt;p&gt;The tables in a relational database is assigned a unique name, usually a name that describe what’s going to be stored in the table.&lt;/p&gt;

&lt;p&gt;Below is diagram showing the use of the relational model to describe the database structure and relationship of data in a photo sharing application. This diagram shows how data is related and separated into different tables. Properly modeling your data is powerful in relational databases  because it reduces the chances of data being duplicated and redundant data being retrieved. &lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/http%3A%2F%2Fleniquenoralez.com%2Fwp-content%2Fuploads%2F2019%2F04%2Fdiagram.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/http%3A%2F%2Fleniquenoralez.com%2Fwp-content%2Fuploads%2F2019%2F04%2Fdiagram.jpg" alt="Data Model Diagram"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The diagram above is know as a schema diagram. A schema diagram is a visual representation of the database schema that shows the relationship in the database, table attributes, primary key and foreign key. &lt;/p&gt;

&lt;p&gt;The &lt;strong&gt;schema&lt;/strong&gt; is the logical design of the database, it includes the table attribute,  attribute type and primary and foreign key constraints.&lt;/p&gt;

&lt;p&gt;The &lt;strong&gt;primary key&lt;/strong&gt; is a set of one or more attribute whose values are used to uniquely identify rows in a table. For example the &lt;em&gt;user_id&lt;/em&gt;, &lt;em&gt;username&lt;/em&gt; and &lt;em&gt;email&lt;/em&gt; in the users table are unique for each user record in the table, these three fields are used to uniquely identify a user.&lt;/p&gt;

&lt;p&gt;A &lt;strong&gt;foreign key&lt;/strong&gt; is a set of attributes that identifies a record in another table, the foreign key in the referencing table is always the primary key in the referenced table.  A foreign key in the above data model would be the &lt;em&gt;uid&lt;/em&gt; in the followers table that references a &lt;em&gt;user&lt;/em&gt; in the user table.&lt;/p&gt;

&lt;p&gt;Building an application that uses a relational database requires a lot of thinking ahead to ensure data is retrieved efficiently. &lt;/p&gt;

&lt;h4&gt;
  
  
  Useful Resources
&lt;/h4&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://www.youtube.com/watch?v=kyGVhx5LwXw" rel="noopener noreferrer"&gt;The Relational Model [YouTube Video] &lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>database</category>
      <category>sql</category>
      <category>datamodel</category>
    </item>
    <item>
      <title>Database Management Systems For Application Development: Introduction</title>
      <dc:creator>Lenique Noralez</dc:creator>
      <pubDate>Sun, 10 Mar 2019 03:45:49 +0000</pubDate>
      <link>https://forem.com/leniquenoralez/database-management-systems-for-application-development-introduction-50nb</link>
      <guid>https://forem.com/leniquenoralez/database-management-systems-for-application-development-introduction-50nb</guid>
      <description>&lt;p&gt;Photo by &lt;a href="https://unsplash.com/@imgix" rel="noopener noreferrer"&gt;imgix&lt;/a&gt; on &lt;a href="https://unsplash.com" rel="noopener noreferrer"&gt;Unsplash&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fimages.unsplash.com%2Fphoto-1506399309177-3b43e99fead2%3Fixlib%3Drb-1.2.1%26ixid%3DeyJhcHBfaWQiOjEyMDd9%26auto%3Dformat%26fit%3Dcrop%26w%3D1648%26q%3D80" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fimages.unsplash.com%2Fphoto-1506399309177-3b43e99fead2%3Fixlib%3Drb-1.2.1%26ixid%3DeyJhcHBfaWQiOjEyMDd9%26auto%3Dformat%26fit%3Dcrop%26w%3D1648%26q%3D80" alt="Computer Server"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;At the heart of all application is the database where all data related to the application is stored.  &lt;/p&gt;

&lt;p&gt;In a series of posts I’ll be discussing how Database Management Systems are used in applications development.&lt;/p&gt;

&lt;p&gt;In this introductory post I’ll be giving a quick overview of some Database terms.&lt;/p&gt;

&lt;h1&gt;
  
  
  Whats is a Database Management Systems?
&lt;/h1&gt;

&lt;p&gt;A Database Management Systems is a software used to properly store, retrieve and update data in a database. A database is a collection of interrelate data. &lt;/p&gt;

&lt;p&gt;A view is a subset of data returned from a query (A query is a request for data from a database). A view hides unnecessary details away from users and provide security to prevent users from accessing restricted data. &lt;/p&gt;

&lt;p&gt;The structure of data is very important in database management systems. The overall design of a database is called a Schema. Schema describes the logical design of a database. Schemas are the blueprint of how the database will be constructed.&lt;/p&gt;

&lt;p&gt;The data model is a way to describe your data, relationships in your data and data consistency and constraints. There are four type of data models:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Relation Model&lt;/li&gt;
&lt;li&gt;Entity-Relationship Model&lt;/li&gt;
&lt;li&gt;Object-based Data Model&lt;/li&gt;
&lt;li&gt;Semistructured Data Model&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;The Relation Model and the Entity-Relationship Model are the most widely used data models. &lt;/p&gt;

&lt;p&gt;Database System provides a data-definition language that is used to specify the database schema and a data-manipulation language that is used to interact with the database. These are not two separate languages, they form a single database language, such as the widely used SQL (Which we will be discussing in a later post). &lt;/p&gt;

&lt;p&gt;DBMS needs to ensure data is safe in the event of crashes and against unauthorized access. Since data in application are usually shared among multiple users, the DBMS must avoid inconsistent result. &lt;/p&gt;

&lt;p&gt;Application often perform multiple operations on the database that count as one unit of work. Transaction must hold the following set of properties:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Atomicity&lt;/li&gt;
&lt;li&gt;Consistency&lt;/li&gt;
&lt;li&gt;Isolation&lt;/li&gt;
&lt;li&gt;Durability &lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;These properties guarantees reliability even in the event of errors or power failure.Transactions that are performed concurrently must be executed with out conflict.&lt;/p&gt;

&lt;p&gt;Data is important to every application. The database can be considered the heart of an application.&lt;/p&gt;

&lt;p&gt;In the coming series of posts I will be going in depth about different database topics using a well-know application as an example.&lt;/p&gt;

</description>
      <category>database</category>
      <category>sql</category>
      <category>software</category>
      <category>application</category>
    </item>
  </channel>
</rss>
