CoderFunda
  • Home
  • About us
    • Contact Us
    • Disclaimer
    • Privacy Policy
    • About us
  • Home
  • Php
  • HTML
  • CSS
  • JavaScript
    • JavaScript
    • Jquery
    • JqueryUI
    • Stock
  • SQL
  • Vue.Js
  • Python
  • Wordpress
  • C++
    • C++
    • C
  • Laravel
    • Laravel
      • Overview
      • Namespaces
      • Middleware
      • Routing
      • Configuration
      • Application Structure
      • Installation
    • Overview
  • DBMS
    • DBMS
      • PL/SQL
      • SQLite
      • MongoDB
      • Cassandra
      • MySQL
      • Oracle
      • CouchDB
      • Neo4j
      • DB2
      • Quiz
    • Overview
  • Entertainment
    • TV Series Update
    • Movie Review
    • Movie Review
  • More
    • Vue. Js
    • Php Question
    • Php Interview Question
    • Laravel Interview Question
    • SQL Interview Question
    • IAS Interview Question
    • PCS Interview Question
    • Technology
    • Other

08 April, 2022

Functional Dependency

 Programing Coderfunda     April 08, 2022     DBMS     No comments   

 

Functional Dependency

Functional dependency is a relationship that exists between two attributes. It typically exists between the primary key and non-key attribute within a table.

  1. X   →   Y  

The left side of FD is known as a determinant, and the right side of the production is known as a dependent.

For example:

Assume we have an employee table with Emp_Id, Emp_Name, Emp_Addressand  attributes.

Here Emp_Id attribute can uniquely identify the Emp_Name attribute of the employee table because if we know the Emp_Id, we can tell that the employee name is associated with it.

Functional dependency can be written as:

  1. Emp_Id → Emp_Name   

We can say that Emp_Name is functionally dependent on Emp_Id.

Types of Functional dependency


DBMS Functional Dependency

1. Trivial functional dependency

  • A → B has trivial functional dependency if B is a subset of A.
  • The following dependencies are also trivial: A → A, B → B

Example:

  1. Consider a table with two columns Employee_Id and Employee_Name.  
  2. {Employee_id, Employee_Name}   →    Employee_Id is a trivial functional dependency as   
  3. Employee_Id is a subset of {Employee_Id, Employee_Name}.  
  4. Also, Employee_Id → Employee_Id and Employee_Name   →    Employee_Name are trivial dependencies too.  

2. Non-trivial functional dependency

  • A → B has a non-trivial functional dependency if B is not a subset of A.
  • When A intersection B is NULL, then A → B is called a complete non-trivial.

Example:

  1. ID   →    Name,  
  2. Name   →    DOB  

Read More
  • Share This:  
  •  Facebook
  •  Twitter
  •  Google+
  •  Stumble
  •  Digg

Relational Calculus

 Programing Coderfunda     April 08, 2022     DBMS     No comments   

 

Relational Calculus

  • Relational calculus is a non-procedural query language. In the non-procedural query language, the user is concerned with the details of how to obtain the end results.
  • The relational calculus tells what to do but never explains how to do it.

Types of Relational calculus:


DBMS Relational Calculus

1. Tuple Relational Calculus (TRC)

  • The tuple relational calculus is specified to select the tuples in a relation. In TRC, the filtering variable uses the tuples of a relation.
  • The result of the relation can have one or more tuples.

Notation:

  1. {T | P (T)}   or {T | Condition (T)}   

Where

T is the resulting tuples

P(T) is the condition used to fetch T.

For example:

  1. { T.name | Author(T) AND T.article = 'database' }  

OUTPUT: This query selects the tuples from the AUTHOR relation. It returns a tuple with 'name' from Author who has written an article on 'database'.

TRC (tuple relation calculus) can be quantified. In TRC, we can use Existential (∃) and Universal Quantifiers (∀).

For example:

  1. { R| ∃T ∈ Authors(T.article='database' AND R.name=T.name)}  

Output: This query will yield the same result as the previous one.

2. Domain Relational Calculus (DRC)

  • The second form of relation is known as Domain relational calculus. In domain relational calculus, filtering variable uses the domain of attributes.
  • Domain relational calculus uses the same operators as tuple calculus. It uses logical connectives ∧ (and), ∨ (or), and ┓ (not).
  • It uses Existential (∃) and Universal Quantifiers (∀) to bind the variable.

Notation:

  1. { a1, a2, a3, ..., an | P (a1, a2, a3, ... ,an)}  

Where

a1, a2 are attributes
P stands for formula built by inner attributes

For example:

  1. {< article, page, subject > |  ∈ javatpoint ∧ subject = 'database'}  

Output: This query will yield the article, page, and subject from the relational javatpoint, where the subject is a database.

Read More
  • Share This:  
  •  Facebook
  •  Twitter
  •  Google+
  •  Stumble
  •  Digg

Integrity Constraints

 Programing Coderfunda     April 08, 2022     DBMS     No comments   

Integrity Constraints

  • Integrity constraints are a set of rules. It is used to maintain the quality of information.
  • Integrity constraints ensure that the data insertion, updating, and other processes have to be performed in such a way that data integrity is not affected.
  • Thus, integrity constraint is used to guard against accidental damage to the database.

Types of Integrity Constraint


DBMS Integrity Constraints

1. Domain constraints

  • Domain constraints can be defined as the definition of a valid set of values for an attribute.
  • The data type of domain includes string, character, integer, time, date, currency, etc. The value of the attribute must be available in the corresponding domain.

Example:


DBMS Integrity Constraints

2. Entity integrity constraints

  • The entity integrity constraint states that primary key value can't be null.
  • This is because the primary key value is used to identify individual rows in relation and if the primary key has a null value, then we can't identify those rows.
  • A table can contain a null value other than the primary key field.

Example:


DBMS Integrity Constraints

3. Referential Integrity Constraints

  • A referential integrity constraint is specified between two tables.
  • In the Referential integrity constraints, if a foreign key in Table 1 refers to the Primary Key of Table 2, then every value of the Foreign Key in Table 1 must be null or be available in Table 2.

Example:


DBMS Integrity Constraints

4. Key constraints

  • Keys are the entity set that is used to identify an entity within its entity set uniquely.
  • An entity set can have multiple keys, but out of which one key will be the primary key. A primary key can contain a unique and null value in the relational table.

Example:


DBMS Integrity Constraints

Read More
  • Share This:  
  •  Facebook
  •  Twitter
  •  Google+
  •  Stumble
  •  Digg

07 April, 2022

Blog Word Prefix in post only wordpress URL

 Programing Coderfunda     April 07, 2022     Wordpress     No comments   

 Copy past and check 

1) Add this rewrite at the end of you function.php


function add_rewrite_rules( $wp_rewrite )
{
    $new_rules = array(
        'blog/(.+?)/?$' => 'index.php?post_type=post&name='. $wp_rewrite->preg_index(1),
    );

    $wp_rewrite->rules = $new_rules + $wp_rewrite->rules;
}
add_action('generate_rewrite_rules', 'add_rewrite_rules'); 

function change_blog_links($post_link, $id=0){

    $post = get_post($id);

    if( is_object($post) && $post->post_type == 'post'){
        return home_url('/blog/'. $post->post_name.'/');
    }

    return $post_link;
}
add_filter('post_link', 'change_blog_links', 1, 3);

2) Go to Settings > Permalinks and click Save Changes.




Create a category called blog and use the permalink structure /%category%/%postname%/.



Read More
  • Share This:  
  •  Facebook
  •  Twitter
  •  Google+
  •  Stumble
  •  Digg

URL prefix for posts WordPress

 Programing Coderfunda     April 07, 2022     Wordpress     No comments   

 


So I have website on a WordPress engine. And I want to make posts urls looks like coderfunda.blogspot.com or http://coderfunda.blogspot.com/blog/categ-name/post-name/. But everything else will look like http://website.com/page-name/. Just want to add prefix 'blog' to urls for all posts but not pages. My permalink settings is /%postname%/. If i will put /blog/%postname%/ I will have 'blog' prefix in every URL of my site :( I can't find solution in WordPress admin backend and I didn't find any acceptable plugin for this. Any help is appreciated, thanks.


Create a category called blog and use the permalink structure /%category%/%postname%/.


1) Add this rewrite at the end of you function.php

function add_rewrite_rules( $wp_rewrite )
{
$new_rules = array(
'blog/(.+?)/?$' => 'index.php?post_type=post&name='. $wp_rewrite->preg_index(1),
);

$wp_rewrite->rules = $new_rules + $wp_rewrite->rules;
}
add_action('generate_rewrite_rules', 'add_rewrite_rules');

function change_blog_links($post_link, $id=0){

$post = get_post($id);

if( is_object($post) && $post->post_type == 'post'){
return home_url('/blog/'. $post->post_name.'/');
}

return $post_link;
}
add_filter('post_link', 'change_blog_links', 1, 3);

2) Go to Settings > Permalinks and click Save Changes.

Read More
  • Share This:  
  •  Facebook
  •  Twitter
  •  Google+
  •  Stumble
  •  Digg

URL prefix for posts WordPress | Use Blog Word Prefix in post only wordpress URL

 Programing Coderfunda     April 07, 2022     Wordpress     No comments   

 

This function use in wordpress function.php file in last .


if you want to change url according your post exp.


https://www.blogger.com/blog/category/postname


"blog" is a prefix 

This is use only post not show in page.

then visite permalink and set fist custome/

category/postname


copy past and check 

1) Add this rewrite at the end of you function.php


function add_rewrite_rules( $wp_rewrite )
{
    $new_rules = array(
        'blog/(.+?)/?$' => 'index.php?post_type=post&name='. $wp_rewrite->preg_index(1),
    );

    $wp_rewrite->rules = $new_rules + $wp_rewrite->rules;
}
add_action('generate_rewrite_rules', 'add_rewrite_rules'); 

function change_blog_links($post_link, $id=0){

    $post = get_post($id);

    if( is_object($post) && $post->post_type == 'post'){
        return home_url('/blog/'. $post->post_name.'/');
    }

    return $post_link;
}
add_filter('post_link', 'change_blog_links', 1, 3);

2) Go to Settings > Permalinks and click Save Changes.




Create a category called blog and use the permalink structure /%category%/%postname%/.









2nd 


function add_rewrite_rules( $wp_rewrite )

{

    $new_rules = array(

        'blog/(.+?)/?$' => 'index.php?post_type=post&name='. $wp_rewrite->preg_index(1),

    );


    $wp_rewrite->rules = $new_rules + $wp_rewrite->rules;

}

add_action('generate_rewrite_rules', 'add_rewrite_rules'); 


function change_blog_links($post_link, $id=0){


    $post = get_post($id);


    if( is_object($post) && $post->post_type == 'post'){

        return home_url('/blog/'. $post->post_name.'/');

    }


    return $post_link;

}

add_filter('post_link', 'change_blog_links', 1, 3);

Read More
  • Share This:  
  •  Facebook
  •  Twitter
  •  Google+
  •  Stumble
  •  Digg
Newer Posts Older Posts Home

Meta

Popular Posts

  • Vue.js Tutorial
      Vue.js Installation Compatibility Check Before going to install and use Vue.js in your project, you should check the compatibility issues....
  • JqueryUI Tutorial
    JqueryUI Tutorial    JqueryUI is the most popular front end frameworks currently. It is sleek, intuitive, and powerful mobile first fr...
  • Laravel - Application Structure
    The application structure in Laravel is basically the structure of folders, sub-folders and files included in a project. Once we create a ...
  • Python Tutorial
      Python   is a general-purpose interpreted, interactive, object-oriented, and high-level programming language. It was created by Guido van...
  • CSS Online Training
    CSS Online Training CSS is used to control the style of a web document in a simple and easy way. CSS is the acronym for "Casca...

Categories

  • Ajax (26)
  • Bootstrap (30)
  • DBMS (42)
  • HTML (12)
  • HTML5 (45)
  • JavaScript (10)
  • Jquery (34)
  • Jquery UI (2)
  • JqueryUI (32)
  • Laravel (1017)
  • Laravel Tutorials (23)
  • Laravel-Question (6)
  • Magento (9)
  • Magento 2 (95)
  • MariaDB (1)
  • MySql Tutorial (2)
  • PHP-Interview-Questions (3)
  • Php Question (13)
  • Python (36)
  • RDBMS (13)
  • SQL Tutorial (79)
  • Vue.js Tutorial (69)
  • Wordpress (150)
  • Wordpress Theme (3)
  • codeigniter (108)
  • oops (4)
  • php (853)

Social Media Links

  • Follow on Twitter
  • Like on Facebook
  • Subscribe on Youtube
  • Follow on Instagram

Pages

  • Home
  • Contact Us
  • Privacy Policy
  • About us

Blog Archive

  • July (4)
  • September (100)
  • August (50)
  • July (56)
  • June (46)
  • May (59)
  • April (50)
  • March (60)
  • February (42)
  • January (53)
  • December (58)
  • November (61)
  • October (39)
  • September (36)
  • August (36)
  • July (34)
  • June (34)
  • May (36)
  • April (29)
  • March (82)
  • February (1)
  • January (8)
  • December (14)
  • November (41)
  • October (13)
  • September (5)
  • August (48)
  • July (9)
  • June (6)
  • May (119)
  • April (259)
  • March (122)
  • February (368)
  • January (33)
  • October (2)
  • July (11)
  • June (29)
  • May (25)
  • April (168)
  • March (93)
  • February (60)
  • January (28)
  • December (195)
  • November (24)
  • October (40)
  • September (55)
  • August (6)
  • July (48)
  • May (2)
  • January (2)
  • July (6)
  • June (6)
  • February (17)
  • January (69)
  • December (122)
  • November (56)
  • October (92)
  • September (76)
  • August (6)

Loading...

Laravel News

Loading...

Copyright © CoderFunda | Powered by Blogger
Design by Coderfunda | Blogger Theme by Coderfunda | Distributed By Coderfunda